|
-
Feb 2nd, 2000, 10:54 PM
#1
Thread Starter
Fanatic Member
I am creating an application that can save, open, create any kind of ODBC database using ADO. My question is, what method would I use to create a database...remember one routine hase to be able to create Access, Excel, FoxPro, etc...Please help this is a time-critical piece..Thanks!
-
Feb 3rd, 2000, 03:02 AM
#2
Frenzied Member
I suspect you're going to have to roll your own. The connection object requires the datasource to be present and you can't do much in ADO without a connection.
Still, I am new to ADO...
-
Feb 3rd, 2000, 03:14 AM
#3
Thread Starter
Fanatic Member
Well, I DO have the Provider, the DSN, and database name...it is just that for example:
if mydb.xls(excel) does not exist then
Set ado_connection = New ADODB.Connection
ado_connection.Open connect_string
...will create the xls file....
BUT
if mydb.mdb(access) does not exist then
Set ado_connection = New ADODB.Connection
ado_connection.Open connect_string
fails!!!
This is why I need a UNIVERSAL routine..
Thanks!
-
Feb 4th, 2000, 03:49 AM
#4
Frenzied Member
It's going to depend on the OLE DB Provider and how it's written to deal with non-existent sources. If SQL Server sources don't exist, for example, the Provider isn't going to have enough information to create a database.
Excel is, more or less, a flat data file. The Excel provider doesn't need special information to make the file.
Best you can do is trap for the error and tell your user the datasource isn't present (if you don't want to write your own creation routines).
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
|