Discussion Locked

How do I Access Connect To MS SQLSERVER

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am developing an application with visual basic 6.0. I use the ADO Connection to connect to SQL SERVER.

My Form Load Event doing the connection to SQL server encounters this error on connection:

Run-Time error ' -+2147467259 (80004005)
[DBNMPNTW]ConnectionOpen (CreateFile())

The workstation I am using is Win98 and the server is Windows NT40 Server. All physical connections are OK. How do I go about this?

7 replies

by peter ritchie

DBNMPNTW is the named pipe library. Make sure you SQL Server is set up to use Named Pipes. TCP/IP is often used exclusively, for performance reasons.

If that's not the case, error 80004005 may occur for several other reasons. Generally it is due to security permissions. Your internet user account may not have permission to create the named pipe file (done via CreateFile()).

by lwachs

If you want to use TCP/IP instead of Named Pipes (as it appears it is currently trying to use), you will need to run the SQL Client Configuration utility (on my NT box, it is C:\WINNT\SYSTEM32\cliconfg.exe, probably C:\WINDOWS\... on a Win98 PC). Run cliconfg.exe, and on the General tab, change the default library to TCP/IP.

Good luck!

by limbo

Are you sure all physical connections are OK???

Are you modeling connection pooling through a single connection?

Are you simply trying to open a second connection using the same object instance?

Why don't you try something like:

If adoConnection.State <> 1 Then
' Open your connection
Else
' Exception: It's open, and I'm opening it again!
End If

If you check the STATE property of your ADO objects you can see if the object instance is open, closed, populated etc.

This discussion is closed to new replies.