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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help coding the Converting of Access Database to SQL Compact Edn

Status
Not open for further replies.

Kieran777

Programmer
Apr 23, 2003
26
0
0
AU
Hi,
I want to read an Access Database to establish the tables in the database then read each tables structure including each field in the table, field type and size. I would also like to read the attributes such as primary key, foreign keys etc.

Does anyone have any Visual Basic 2005 code to do this?

Ultimately, I want to create the Access Database in SQL Compact Edn Database. Then I want to copy the data in each of the tables to the new SQL CE database tables.

I can write the code to do it for specific tables and fields but I am looking for code that will do it more generically, i.e., reading the Access Database and establishing a list of tables then reading each table and establishing a list of fields and the fields attributes. Each time creating the table in SQL and adding the fields and equivilent SQL type for that field.

Does anyone have any code that can do that. (I am aware of the Access Upsizing Tool that can do this from within the Access Database but I need to create an application to upgrade the Access Database)

regards Kieran777
 
I am 99% certain that there is an FAQ on pulling out all the info from an Access database, which gives you VBA code to do exactly what you need. It shouldn't be too difficult to convert that to .Net. I've had a quick look, but haven't found it.

It definitely is not that difficult to write.

Hope this helps.

[vampire][bat]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top