Results 1 to 2 of 2
  1. #1
    sridhar is offline Novice
    Windows Vista Access 2003
    Join Date
    Nov 2009
    Posts
    2

    Using ADO get access database name

    Hi guys,



    I am using ADO to connect to Access (.mdb) database. I want to populate data from access to excel, edit the data in excel and post the modified data back to access.

    My first task is to get the name of the database. I am using ADO for that.

    Please find the code below which gives me an error saying "Object or provider is not capable of performing requested action". I am just trying to open a connection and use OpenSchema to get the name of the database.

    Dim cn As New ADODB.Connection
    Dim rsTemp as New ADODB.Recordset

    cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & FileToOpen & ";"
    cn.CursorLocation = adUseServer
    cn.Open

    Set rsTemp = cn.OpenSchema(adSchemaCatalogs)

    Debug.Print "*********** START ***********" & vbCr
    While Not rsTemp.EOF
    Debug.Print "Catalog name: " & rsTemp!CATALOG_NAME & vbCr
    rsTemp.MoveNext
    Wend
    Debug.Print "*********** END ***********" & vbCr

    rsTemp.Close
    Set rsTemp = Nothing
    cn.Close
    Set cn = Nothing

    I tried various types like adSchemaSchemata and many more. They give me the same error. I did lot of googling but nothing helped me.

    Any help is truly appreciated..

    Thank you

  2. #2
    llkhoutx is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Location
    Houston, Texas USA
    Posts
    373
    "FileToOpen" should include the complete path, file name and file extension.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Access database to Mysql
    By fsmikwen in forum Access
    Replies: 4
    Last Post: 11-16-2009, 05:40 AM
  2. Using ADO get access database name
    By sridhar in forum Programming
    Replies: 0
    Last Post: 11-14-2009, 06:18 PM
  3. Remote database access
    By marleyuk in forum Programming
    Replies: 0
    Last Post: 01-15-2009, 01:43 PM
  4. Redesigning an access database
    By frankl in forum Database Design
    Replies: 0
    Last Post: 08-17-2007, 10:52 AM
  5. Access database synchronizing.. help!
    By mhq04 in forum Database Design
    Replies: 0
    Last Post: 12-12-2005, 03:28 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
  •  
Other Forums: Microsoft Office Forums