> Best bet is to have an empty Access database at hand to 
> copy into the location that you want it and then create 
> the tables etc. using standard SQL (that part is really 
> RTFM), but AFAIK it is impossible to do the actual 
> database creation in SQL.

You might not be able to do it in your SQL script, but you can certainly do
it when you create the ODBC data source, if you do it from the server
console. In addition, you can do it programmatically from COM clients, like
Windows Script Host and even from CF:

<cfscript>
strDBPath = "d:\test_create.mdb";
catNewDB = CreateObject("COM", "ADOX.Catalog");
catNewDB.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
strDBPath);
catNewDB = "";
</cfscript>

Note that if you do this from CF, it'll create the database, then lock it
exclusively until the server is cycled! Alternatively, you could write a WSH
file that does the same thing, and call that from CFEXECUTE, passing it the
path for the new database as the single required argument:

CreateAccessDatabase WScript.Arguments.Item(0)

Sub CreateAccessDatabase(strDBPath)
   Dim catNewDB
   Set catNewDB = CreateObject("ADOX.Catalog")
   catNewDB.Create "Provider=Microsoft.Jet.OLEDB.4.0;" & _
         "Data Source=" & strDBPath
   Set catNewDB = Nothing
End Sub

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to