Results 1 to 2 of 2

Thread: [RESOLVED] - Database Connection Validity

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2002
    Location
    UK
    Posts
    147

    [RESOLVED] - Database Connection Validity

    Can anyone help me with this?

    I am looking to prove that a database connection is valid before i try and access the database for information.
    I could just access a table and select all the record which if the select completed without and error would tell me that the connection is OK, but i would like to do it more efficiently so if you have any suggestions please let me know.

    Thanks in advance.
    Last edited by mik706; Jul 3rd, 2003 at 09:45 AM.
    Mik706

  2. #2
    Frenzied Member
    Join Date
    Nov 2001
    Posts
    1,384
    Code:
        Set Cn = New ADODB.Connection
        Cn.CursorLocation = adUseClient
        Cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source= " & Startup.AppPath & "data.mdb"
        MsgBox Cn.State
    Connected sucessfully if 1 is returned
    Mel

Posting Permissions

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



Click Here to Expand Forum to Full Width