Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't connect to Sql Server while debugging VB Code

Status
Not open for further replies.

squirleegirl

Programmer
Joined
Jun 24, 2003
Messages
59
Location
US
I'm debugging a program in Visual Basic that connects to a sql server. I'm working on a laptop that has both the database and my program on it so I know the network isn't the problem.

When I go to debug, I get my login screen for my app and when I try to actually log in, I get a run-time error [DNETLIB][Connection Open(Connect()).] Sql Server does not exist or access is denied.

If I debug, the line of code causing the error is
oConn.Open (sConnString) and if I "hover" over that to see what it is trying to connect to, it says
sConnString = 'Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;In...

So basically, that means nothing to me. However, if I compile the program and run it, it connects to the database just fine. But, its making it very difficult to figure out what the problem in my code is since I can't use debug.

On my desktop, debugging works just fine. But, unfortunately, I am on the road and must use the laptop.

Does anyone have any suggestions as to what the problem is? I've checked the ODBC connections and they seem fine.

Thanks,
Squirleegirl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top