|
-
March 13th, 2001, 10:18 AM
#1
Create Access 97 database using ado
Can anyone tell me how I could create a access 97 database using ado.
Thanks
Peter
-
March 13th, 2001, 11:07 AM
#2
Re: Create Access 97 database using ado
Make sure you have a reference set to the ADOX object library then use the following code.
Dim objCatalog as ADOX.Catalog
Set objCatalog = New ADOX.Catalog
objCatalog.Create "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\mynewdb.mdb"
Iouri Boutchkine
[email protected]
-
March 13th, 2001, 11:16 AM
#3
Re: Create Access 97 database using ado
I have tried this but can only access the database through access 2000.
Thanks
-
March 13th, 2001, 11:43 AM
#4
Re: Create Access 97 database using ado
change provider from
Provider=Microsoft.Jet.OLEDB.4.0;"
to
Provider=Microsoft.Jet.OLEDB.3.51;"
Iouri Boutchkine
[email protected]
-
March 19th, 2001, 06:12 AM
#5
Re: Create Access 97 database using ado
Sub CreateDatabaseX()
Dim wrkDefault As Workspace
Dim dbsNew As Database
Dim prpLoop As Property
' Get default Workspace.
Set wrkDefault = DBEngine.Workspaces(0)
' Make sure there isn't already a file with the name of
' the new database.
If Dir("c:\tstproj\proj2\NewDB.mdb") <> "" Then Kill "c:\tstproj\proj2\NewDB.mdb"
' Create a new encrypted database with the specified
' collating order.
Set dbsNew = wrkDefault.CreateDatabase("c:\tstproj\proj2\NewDB.mdb", _
dbLangGeneral, dbEncrypt)
' With dbsNew
' Debug.Print "Properties of " & .Name
' ' Enumerate the Properties collection of the new
' ' Database object.
' For Each prpLoop In .Properties
' If prpLoop <> "" Then Debug.Print " " & _
' prpLoop.Name & " = " & prpLoop
' Next prpLoop
' End With
dbsNew.Close
End Sub
i guess this shud help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|