-
Error connecting to SQL Server 7.0
Hi guys, hope you can help me out on this. Sorry if this is the wrong group
to post to. I was not sure if I should post to here or the ADO group. But
my problem is that when I am trying to connect to SQL Server I am getting
the error:
-2147467259 - [DBMSSOCN]General network error. Check your network documentation.
Now, I do not get the error on the same line of code all the time. It can
be on a different line, in a different function, and I do not get it when
I step through the code, and sometimes it works perfectly. It generally
gives the error in one of the functions *after* I open a different form and
execute a stored procedure that returns records. I have several functions
that return values retrieved from SQL Server. Here is a sample of what one
of the functions looks like:
Function Get_Product_FBMCONV(ByVal pID As Long) As Double
On Error GoTo errH
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open "Select [FBMCONV] from INVENTORY_MASTER where INVENTORY_MASTER.[ID]
= " & pID, "Provider=SQLOLEDB;Server=TestServer;Database=BayridgeTest;
Trusted_Connection=No;UID=sa;PWD;", adOpenStatic, adLockReadOnly,
adCmdText
Set rs.ActiveConnection = Nothing
If rs.EOF Then Get_Product_FBMCONV = 0 Else Get_Product_FBMCONV = rs!FBMCONV
rs.Close
Set rs = Nothing
errH:
If Err <> 0 Then If ErrP("Get_Product_FBMCONV", Err) = 0 Then Resume
Next Else Resume
End Function
Now, I do get an error on the server when attempting to connect to SQL Server
either through Query Analyzer or Enterprise Manager. That error is:
A connection could not be established to "ServerName" - Specified driver
could not be loaded due to system error 126 (SQL Server)
I do not know if that error would cause the previous error. I do not have
a problem connecting from my development machine to the server, using either
Query Analyzer or Enterprise Manager. I have looked on Microsofts site for
any help, but to no avail so far. Sorry for being so long winded.
Thanks for any help,
Darcey
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks