Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: creating mdb file using ADO


Message #1 by Paulo Roberto Lobo <prlobo@i...> on Wed, 17 Jan 2001 11:25:43 -0200
Hi,



Does anybody knows how I could create an .mdb file using the ADO?



Thanks for the help!



[[ ]]'S



Message #2 by John Pirkey <mailjohnny101@y...> on Wed, 17 Jan 2001 07:14:48 -0800 (PST)
You have to use ADOX - use the Catalog.Create method, then use the table collection

to build  a new table.  here's a sample:



Dim objDB As ADOX.Catalog

Dim oTable As ADOX.Table



Set objDB = New ADOX.Catalog



objDB.Create "provider=microsoft.jet.oledb.3.51;data source=f:\john2.mdb;"



Set oTable = New ADOX.Table

oTable.Name = "John1"

oTable.Columns.Append "MyColumn", adInteger



objDB.Tables.Append oTable



Set objDB = Nothing

Set oTable = Nothing



ADOX is available with ADO 2.1.  it's reference name is Microsoft ADO Ext. 2.1 for

DLL and Security.



hope this helps,



john







--- Paulo Roberto Lobo <prlobo@i...> wrote:

> Hi,

> 

> Does anybody knows how I could create an .mdb file using the ADO?

> 

> Thanks for the help!

> 

> [[ ]]'S

> 



---------------------------- 

John Pirkey 

MCSD 

John@S... 

http://www.stlvbug.org



Message #3 by "Paulo Roberto Campos de Morais Lobo" <prlobo@i...> on Thu, 18 Jan 2001 11:17:21 est
Hi, 



  Thank you so much for the help, John!!

  It was very usefull...



[[ ]]'S 

  





>You have to use ADOX - use the Catalog.Create method, then use the 

>table

> collection

>to build  a new table.  here's a sample:

>Dim objDB As ADOX.Catalog

>Dim oTable As ADOX.Table

>Set objDB = New ADOX.Catalog

>objDB.Create "provider=microsoft.jet.oledb.3.51;data 

>source=f:\john2.mdb;"

>Set oTable = New ADOX.Table

>oTable.Name = "John1"

>oTable.Columns.Append "MyColumn", adInteger

>objDB.Tables.Append oTable

>Set objDB = Nothing

>Set oTable = Nothing

>ADOX is available with ADO 2.1.  it's reference name is Microsoft 

>ADO Ext.

> 2.1 for

>DLL and Security.

>hope this helps,

>john





--- Paulo Roberto Lobo <prlobo@i...> wrote:

>> Hi,

>> 

>> Does anybody knows how I could create an .mdb file using the ADO?

>> 

>> Thanks for the help!

>> 

>> [[ ]]'S

>> 


  Return to Index