Results 1 to 5 of 5

Thread: [RESOLVED] [VBA/ADO] Check for database present

Threaded View

  1. #1

    Thread Starter
    Fanatic Member Ggalla1779's Avatar
    Join Date
    Feb 2006
    Location
    Glasgow
    Posts
    532

    Resolved [RESOLVED] [VBA/ADO] Check for database present

    Hi all

    I have an excel spreadsheet that pulls data out of Access via ADO

    ie
    Code:
    Set cn = New ADODB.Connection
        cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & strDb & ";"
        Set rs = New ADODB.Recordset
     
        With rs
            Set .ActiveConnection = cn
            .Open strQry
    When these spreasheets are sent offsite I would like to put a check in for no database and if none just skip the on load routine to refresh the Excel data from the database.... how cleanly can I test for the database not being there? So the offsite doesnt see an error

    cheers George
    Last edited by Ggalla1779; Apr 12th, 2010 at 08:59 AM.

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