Database programmatically supposedly created - but invisible - RESOLVED RRS feed

  • Question

  • User-1849662045 posted

    I want to use ADOX to programmatically list queries stored in my Access database. As a precursor to this - to get used to the ADOX object model - I used the code at http://www.mikesdotnetting.com/article/4/adox-ms-access-and-asp to create and populate a database. A snippet from this code is:

    Dim objADOXDatabase
      'Instantiate a Catalog object
      Set objADOXDatabase = CreateObject("ADOX.Catalog")
      'Use the Create method, passing the Datasource Provider 
      'and full path and file name as parameters
      objADOXDatabase.Create "Provider=Microsoft.Jet.OLEDB.4.0;" & _
      "Data Source=PathToDatabasecustomers.mdb"
      'The database now exists...

    The rest of the code populates the database and puts a message to the screen confirming creation.

    My problem is:

    1) Browsing to the folder, the database does not appear.

    2) Rerunning the script generates the error message: "Microsoft JET Database Engine error '80040e17' Database already exists."

    3) I now realise that I can't programmatically delete the database (and can't delete it by hand as it's invisible).

    I'm an ADOX beginner and I'm stuck .

    Wednesday, March 2, 2016 10:33 AM


  • User-1849662045 posted

    How embarrassing...


    DB = Server.MapPath ("/Databases/") & "PathToDatabasecustomers.mdb"

    I ended up creating DatabasesPathToDatabasecustomers.mdb in the root.

    Using DB = Server.MapPath ("/Databases/" & "PathToDatabasecustomers.mdb")

    creates PathToDatabasecustomers.mdb in /Databases/ 

    as expected.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 2, 2016 5:39 PM

All replies