I looked into this but didn't get very far. ADOX help isn't functioning on
my system, so I'm afraid I don't think there's much more I can do, but this
is as far as I got, if you want to investigate it futher yourself ...
Public Sub CreateDatabaseADOX()
'Connection string below copied from a UDL file.
'Provider=Microsoft.Jet.OLEDB.4.0;
'Data Source=C:\Documents and Settings\Brendan Reynolds\My
Documents\db1.mdb;
'Persist Security Info=False;
'Jet OLEDB:System database=C:\Documents and Settings\Brendan Reynolds\My
Documents\Custom.mdw
Dim cat As ADOX.Catalog
Dim strConnect As String
Set cat = New ADOX.Catalog
cat.ActiveConnection = CurrentProject.Connection
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Documents and Settings\Brendan Reynolds\My
Documents\ADOXTest.mdb;" & _
"Persist Security Info=False;" & _
"Jet OLEDB:System database=C:\Documents and Settings\Brendan
Reynolds\My Documents\Custom.mdw"
cat.Create strConnect
End Sub
Code fails with following error message ...
-2147217887 (80040E21)
Multiple-step OLE DB operation generated errors. Check each OLE DB status
value, if available. No work was done.
--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com
The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.