Results 1 to 2 of 2

Thread: Testing DAO connection

  1. #1

    Thread Starter
    Addicted Member icemanmt78's Avatar
    Join Date
    May 2000
    Posts
    142

    Angry

    I am trying to find out how to test connections to databases.

    How do i test if a database i am connecting to has opened correctly. Is there a property that will give me a boolean value.

    Also when i run a sql statement that will populate a new table, am i able to interrogate the table with DAO to see if its been populated. Any help would be good .

    Finally, is there a way of interrogating a database to see if a table exists.

    I am using VB5 DAO and ACCCESS 97

    M

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    Originally posted by icemanmt78
    I am trying to find out how to test connections to databases.

    How do i test if a database i am connecting to has opened correctly. Is there a property that will give me a boolean value.

    M
    Check err.number after issuing the open. If it's not 0 you had a problem opening the database.

    Originally posted by icemanmt78
    Also when i run a sql statement that will populate a new table, am i able to interrogate the table with DAO to see if its been populated. Any help would be good .
    M [/B]
    Select count(*) from table

    If you run before and after your population you will find out how many records (if any) have been added, assuming no one else is doing the same thing at the same time.

    Originally posted by icemanmt78
    Finally, is there a way of interrogating a database to see if a table exists.

    I am using VB5 DAO and ACCCESS 97

    M [/B]
    As before, select count(*) from table, then check the err.number returned after the SQL execution.

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