Wrox Programmer Forums
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 26th, 2005, 02:58 AM
Registered User
Join Date: Feb 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL server connection error

I have a VB 6.0 application which has commands to access a SQL Server 2000 database. Ex:
EZCONN.Open "Provider=SQLOLEDB.1;data source=" & GDBSource & ";Initial Catalog=" & GDBName, GDBUserName, GDBPassword
Where i am reading the parameters from INI file. and the server parameters are given correctly. This line returns the following error:

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

Actually I am updating some CSV files to the database. For that I am calling databaseupdate procedure and the files gets updated one by one in a loop. I am opening the connection before the loop and i am closing it on form_unload event. The code is written in commandbutton_click event and it gets called once in the form_load event and then I am ending the application. The application is a standalone exe that runs at startup. so there is no any possibility of calling the click event twice. However it is giving this error while updating some files not for all the files. some files are getting updated to the database.

Can anyone tell what is the reason for this error and what is the solution?
please reply ASAP

Old February 26th, 2005, 06:03 AM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

Hi there,

It looks like your connection string is not OK. Check this page for the correct connection string:


AFAICS, your password / username are not in the correct format.


Imar Spaanjaars
Everyone is unique, except for me.
Old February 28th, 2005, 01:57 AM
Registered User
Join Date: Feb 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts


thanks for your reply.

yes the connection string was not proper but then how the application is working ok. The application is working fine since last 3 months. Only sometimes it gives the stated error regarding SQL server not available. The application updates some CSV files to the database successfully using the same connection string as I have given in the earlier post and sometimes it does not update the file to the database giving the error of [DBNETLIB] - is this related to network/port settings. Is it giving this error because of network accessibility problem? If connection string is not proper then it should give error for all the files.

Please reply ASAP.

Thanks again.
Old April 4th, 2005, 04:17 AM
Friend of Wrox
Join Date: Oct 2004
Posts: 224
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to ashu_from_india Send a message via Yahoo to ashu_from_india

Hi Mayuri25

i think it is bcoz of network problem. make sure tht ur server is in the same Domain. also configure SQL Server user with Windows user

Old September 12th, 2005, 05:42 AM
Authorized User
Join Date: Aug 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to CarlosV

now i'm using this and i don't have any problem
Set Conn1 = New Connection
Conn1.ConnectionString = "driver={SQL Server};server=Carlos;uid=;pwd=;database=SysDB; Trusted_Connection=Yes;"

Similar Threads
Thread Thread Starter Forum Replies Last Post
Remote connection error with SQL Server Express DudeBori82 SQL Server 2005 4 April 12th, 2009 01:51 AM
sql server pool connection error MunishBhatia SQL Server 2005 0 June 28th, 2007 11:40 AM
SQL Server remote connection error sterreyl ASP.NET 2.0 Basics 1 April 6th, 2007 07:17 PM
SQL Server Connection error shivani_desai SQL Server 2000 1 January 16th, 2005 03:53 AM
SQL Server Connection mpeterson Classic ASP Databases 1 July 8th, 2003 09:50 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.