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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Connection to Database Error

Status
Not open for further replies.

arrian

Programmer
Nov 11, 2003
93
CA
When I try to open a connection to my access database, it's suddenly not working anymore. I have a loop where the connection is opened several times, and it goes through it a few times, but then it won't connect anymore. It gives me an unspecified error. I can't, for the life of me, figure out what's wrong. It was working just fine up until yesterday.
 
put the open command in a try catch block. If that exception is unspecified, check the innerexception.

Code:
try
  cnn.open
catch exc as exception
  debug.writeline exc.message
  if not exc.innerexception is nothing then
    debug.writeline exc.innerexception.message
  end if
end try

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Just tried adding that to my try catch block, and it won't go into the if because it says that the innerexception is nothing. Any other ideas? I'm at a loss here...
 
What's the exception message? You mentioned a loop, do you need to have multiple connections open? If so, does it always bomb out at the same itteraiton? Win2k Pro only allows 10 connections at a time, so if the database is on a 2k Pro box and it's bombing on the 10th itteration, I would suspect that the license is bouncing the connection.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
I'm running Windows XP, and the connections are closed one the program is done with it. There's no more than 2 or 3 connections to the database open at any one time. I thought it might be table corruption, but it's doing it on other tables as well. It also seems to be at a random number of times through it. Some times it bombs out at the 3rd connection attempt, others it's gone through 900+ and hasn't bombed out. The exception message is "Unspecified Error" and the number for that message is 5.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top