Click here to Skip to main content
15,900,461 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to convert .mdf file to .mdb or .accdb
Posted
Updated 2-Jun-12 1:23am
v2

1 solution

I suppose you are talking about migrating a database from SQL Server to Access.
Well the sort answer is: forget it, because SQL Server database is far more complex than Access database, thus you can loose very-very much of it's content. But if you want to transfer only the data, that's possible. In SQL Manager there is an import-export feature. Have you tried it?
If you want to do the same in c#, follow these steps:
1) Open source (sql) database
2) Open or create destination (access) database
3) For all tables in source:
3.1) Create the same structure in destination (without reference constraints)
3.2) Copy data from source to destination
3.3) Create reference constraints in destination
4) For all views in source:
4.1) Create views in destination (might have to add some logic, since the functions you can reference are not the same - this is why data export in SQL Manager is creating tables from views)
But, if you want to have a lightweight, embedded kind of sql server to be able to deploy it with your application, than you better use SQL Server compact edition[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900