Results 1 to 4 of 4

Thread: ODBC routines! Please Help!!

  1. #1

    Thread Starter
    Fanatic Member clarkgriswald's Avatar
    Join Date
    Feb 2000
    Location
    USA
    Posts
    799

    Post

    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!

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    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...

  3. #3

    Thread Starter
    Fanatic Member clarkgriswald's Avatar
    Join Date
    Feb 2000
    Location
    USA
    Posts
    799

    Post

    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!

  4. #4
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    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
  •  



Click Here to Expand Forum to Full Width