Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OLEDB/ADO Database Table Creation ?
Message
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00559939
Message ID:
00559961
Views:
26
Hi!
You need to use ADOX instead of ADODB.
The followind sample demostrates how to create table in VB:
' BeginCreateTableVB
Sub CreateTable()

   Dim tbl As New Table
   Dim cat As New ADOX.Catalog

'Open the catalog.
   ' Open the Catalog.
   cat.ActiveConnection = _
      "Provider=Microsoft.Jet.OLEDB.4.0;" & _
      "Data Source=c:\Program Files\Microsoft Office\" & _
      "Office\Samples\Northwind.mdb;"

   tbl.Name = "MyTable"
   tbl.Columns.Append "Column1", adInteger
   tbl.Columns.Append "Column2", adInteger
   tbl.Columns.Append "Column3", adVarWChar, 50
   cat.Tables.Append tbl

End Sub
' EndCreateTableVB
>I am trying to hack through the MSKB JET OLEDB samples to figure out how to create a database and tables and indexes through VBScript. So far I am not getting very far. Has anyone already tried to do this?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform