Results 1 to 3 of 3

Thread: Using ADO to create a database

  1. #1
    DerFarm
    Guest

    Using ADO to create a database

    I give up. I've looked for 2 hours now,

    how do you create a new database (not a table) in ADO?

  2. #2
    Fanatic Member
    Join Date
    Aug 2001
    Location
    Connecticut
    Posts
    855
    Public Function MakeJetDB(strDBPathName As String) _

    As Boolean

    Dim objCat As ADOX.Catalog

    'Create new Catalog object

    Set objCat = New ADOX.Catalog

    'Use the Create method to create a new database

    objCat.Create "Provider=Microsft.Jet.OLEDB.4.0;" & _

    "Data Source=" & strDBPathName

    End Function

    from

    http://www.wiley.com/legacy/compbooks/press/march4.html
    VB 6.0, Access, Sql server, Asp

  3. #3
    DerFarm
    Guest
    Ok, than didn't work. Using the following code:

    Public Sub MakeJetDB(strDBPathName As String)
    Dim objCat As ADOX.Catalog

    Set objCat = New ADOX.Catalog

    objCat.Create "Provider=Microsft.Jet.OLEDB.4.0;" & _
    "Data Source=" & strDBPathName

    Xit_MakeJetDB:
    On Error GoTo 0
    End Sub


    I get the error: class is not registered.

    I have a reference to MS ADO Ext. 2.5 for DDL and Security
    strDBPathName= "C:\xxx.mdb" ---> doesn't exist.


    Any ideas?

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