+ Reply to Thread
Results 1 to 4 of 4

How to test ODBC connection

  1. #1
    Registered User
    Join Date
    12-12-2008
    Location
    South Africa
    Posts
    6

    How to test ODBC connection

    I have created a system DSN to an SQL Database programmatically and would like to test the database connection via a command button before executing any queries against the database.

    Can anyone help me write this?

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: How to test ODBC connection

    How are you invoking your queries - ADO ?

    If so, why not just add an Error trap at the point of creating the connection ?

    ie along the lines of:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-12-2008
    Location
    South Africa
    Posts
    6

    Re: How to test ODBC connection

    I used the below function (in conjunction with others) to create the DSN

    Please Login or Register  to view this content.
    and then the below to query the data when required.

    Please Login or Register  to view this content.

  4. #4
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: How to test ODBC connection

    Doesn't the database provide a tool that alloows you to create the DSN and run a test against it?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1