Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a table in Access via ADO.net

Status
Not open for further replies.

Shake412

Programmer
Apr 17, 2002
55
0
0
GB
I'm fairly new to .net and am trying to create an app which uses Access as a back end. I need to create a table dynamically and populate it with data. This is no problem using a DataSet and DataTable, however I want to save this table in an Access DB.

How is this done, good old DAO was CreateTableDef, etc. Is there an equivalent in ADO.net?

Thanks
Paul
 
Using an object model, you would need to still reference DAO or ADOX through ActiveX.

Using pure ADO.net, you will need to issue everything as a DDL SQL statement:

Code:
CREATE TABLE tblCompany (
   ID INTEGER PRIMARY KEY, 
   Name VARCHAR(100), 
   Address VARCHAR(100), 
   City VARCHAR(50), 
   State VARCHAR(5), 
   Zip VARCHAR(10), 
   Phone VARCHAR(50), 
   Fax VARCHAR(50))

Check the help in Access under Microsoft Jet SQL Reference (twice), Data Definition Language or use these three articles on MSDN:



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top