A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to automate creation of database?



 
 
Thread Tools Display Modes
  #1  
Old June 12th, 2008, 01:31 AM posted to microsoft.public.access.tablesdbdesign
Siegfried Heintze[_2_]
external usenet poster
 
Posts: 4
Default How to automate creation of database?

The following code results in "No Such interface supported".

What am I doing wrong? I'm trying to create an Access database.
thanks,
Siegfried
'ADOXcatalog.Create("Provider=Microsoft.Jet.OLEDB. 4.0;Data
Source=" & sFileName)
ADOXcatalog.Create("Driver={Microsoft Access Driver
(*.mdb)};Dbq=" & sFileName & ";Uid=Admin;Pwd=; ")

errhandler:
If Err.Number = -2147217897 Then
MsgBox("Database already exists")
ElseIf Err.Number 0 Then
MsgBox("Err " & Err.Description & "; operation not
complete")
End If

  #2  
Old June 12th, 2008, 02:46 AM posted to microsoft.public.access.tablesdbdesign
Allen Browne
external usenet poster
 
Posts: 11,706
Default How to automate creation of database?

Try this example:
http://allenbrowne.com/func-ADOX.htm...teDatabaseAdox

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Siegfried Heintze" wrote in
message
...
The following code results in "No Such interface supported".

What am I doing wrong? I'm trying to create an Access database.
thanks,
Siegfried
'ADOXcatalog.Create("Provider=Microsoft.Jet.OLEDB. 4.0;Data
Source=" & sFileName)
ADOXcatalog.Create("Driver={Microsoft Access Driver
(*.mdb)};Dbq=" & sFileName & ";Uid=Admin;Pwd=; ")

errhandler:
If Err.Number = -2147217897 Then
MsgBox("Database already exists")
ElseIf Err.Number 0 Then
MsgBox("Err " & Err.Description & "; operation not
complete")
End If


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:11 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.