Is there a method in ADO similar to CreatDataBase in DAO ? 
Author Message
 Is there a method in ADO similar to CreatDataBase in DAO ?

As the subject says,
I'm looking for a similar method to create database files from
scratch. I know that ADO should be db independent (and is) but DAO
could do more than just Jet/Access.

Regards,
Nick Smith,
NiXDeV.


Pilot/Database Reporting and Printing
http://www.*-*-*.com/

Online API Guide:
http://www.*-*-*.com/
*****************************



Sun, 25 Nov 2001 03:00:00 GMT  
 Is there a method in ADO similar to CreatDataBase in DAO ?
ADO doesn't provide much by way of DDL (Data Definition Language)
functionality. It assumes you have an intelligent back-end server for such
work, and so concentrates on DML tasks.

In that sense, unlike with DAO, you can't create databases and the like on
the fly.  However you *can* execute arbitrary SQL with ADO, and the SQL can
create a database, or whatever.



Mon, 26 Nov 2001 03:00:00 GMT  
 Is there a method in ADO similar to CreatDataBase in DAO ?

Quote:
>ADO doesn't provide much by way of DDL (Data Definition Language)
>functionality. It assumes you have an intelligent back-end server for such
>work, and so concentrates on DML tasks.
>In that sense, unlike with DAO, you can't create databases and the like on
>the fly.  However you *can* execute arbitrary SQL with ADO, and the SQL can
>create a database, or whatever.

I find this to be an interesting statement as I'm using ADO 2.1 to completely
create an Access DB "on the fly" if it's not found.  =)

The library you need is "Microsoft ADO Ext. for DDL and Security" (ADOX).

Below is the code I'm using to create the db and a single table...the project
is under development:

-Curtis Spendlove
-Solstice Software

-----
Private Const kMSJetOLEDB351 = "Microsoft.Jet.OLEDB.3.51;"

Private Sub cmdCreate_Click()
  Dim cat     As ADOX.Catalog
  Dim tbl     As ADOX.Table

  Set cat = New ADOX.Catalog
  cat.Create "Provider=" & kMSJetOLEDB351 & "Data Source=" & App.Path &
"\plnesage.mdb" & ";"

  Set tbl = New ADOX.Table
  tbl.Name = "tblUserMaster"
  tbl.Columns.Append "um_id", adInteger
  tbl.Columns.Append "um_uname", adVarChar, 20
  tbl.Columns.Append "um_upswd", adVarChar, 20
  tbl.Columns.Append "um_fname", adVarChar, 20
  tbl.Columns.Append "um_lname", adVarChar, 20
  cat.Tables.Append tbl
  Set tbl = Nothing

  Set cat = Nothing

  Form_Load
End Sub
-----



Tue, 27 Nov 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. ADO find method compare with DAO findfirst method...

2. Searching with ADO (What is the equivalent of the DAO FindFirst method)

3. ADO : Query too complex (or something similar!)

4. similar problem to TA3 - ADO -VB - MSACCESS Problem

5. I am stuck with DAO need help please

6. Please tell me what I am doing wrong - DAO parameter Append Query :(

7. ADO methods vs ADO commands - Which is faster?

8. VB4 and DAO 3.6 Update method Compile Error

9. Which method works faster:DAO or SQL

10. Edit Method - DAO Example

11. DAO Find First Method

12. Am I using the wrong ADO

 

 
Powered by phpBB® Forum Software