Jump to content

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Status Updates

View All Updates

- - - - -

validating database connection


  • Please log in to reply
4 replies to this topic

#1 roi


    CC Lurker

  • Just Joined
  • Pip
  • 2 posts
  • Programming Language:C#, (Visual) Basic
  • Learning:C#, (Visual) Basic

Posted 14 August 2012 - 04:42 AM

hi guys..im really having a hard time dealing with how to validate database connection in vb 6.0 using adodc...i hope u can help.tnx..
  • 0

#2 VNFox


    CC Devotee

  • Senior Member
  • PipPipPipPipPipPip
  • 648 posts
  • Programming Language:C#, PHP
  • Learning:Assembly

Posted 14 August 2012 - 03:36 PM

I do not understand what do you mean by validating database connection? Can you explain in details ?
  • 0

I don't just develop software. I find solutions to your business needs.

#3 roi


    CC Lurker

  • Just Joined
  • Pip
  • 2 posts
  • Programming Language:C#, (Visual) Basic
  • Learning:C#, (Visual) Basic

Posted 15 August 2012 - 01:22 AM

its when the database which i am trying to connect to resides in another pc or laptop and i deliberately detach the UTP cable..i just dont want that runtime error to appear ive been having difficulty trying to solve this problem..someone told me to declare file validity but i just don't get it...
  • 0

#4 Colanth


    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 165 posts
  • Location:Fayetteville, NC, USA
  • Programming Language:PHP, (Visual) Basic, JavaScript, Visual Basic .NET, Pascal, Logo, Assembly, VBScript, Others

Posted 22 September 2012 - 07:16 PM

Execute an onerror statement before you attempt to connect to the database. If the connection fails, your error code will trap it and give the user a nice neat message.

Disconnect the cable, set a breakpoint in the error code and run the program. When it breaks, debug.print error,number and you'll know which error number to trap for the "Your UTP cable appears to be disconnected. Please call the IT department." messagebox. Then you can exit the program nicely or do what ever else you want at that point.
  • 1

#5 BlackRabbit


    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts
  • Location:Argentina
  • Programming Language:C, C++, C#, PHP, JavaScript, Transact-SQL, Bash, Others
  • Learning:Java, Others

Posted 22 September 2012 - 07:21 PM

Excellent answer by collant
  • 0

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download