如何将.mdf文件转换为.mdb或.accdb [英] how to convert .mdf file to .mdb or .accdb

查看:922
本文介绍了如何将.mdf文件转换为.mdb或.accdb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将.mdf文件转换为.mdb或.accdb

how to convert .mdf file to .mdb or .accdb

推荐答案

我想您正在谈论将数据库从SQL Server迁移到Access的问题.
好的答案是:算了吧,因为SQL Server数据库比Access数据库复杂得多,因此您可以释放很多内容.但是,如果您只想传输数据,那是可能的.在SQL Manager中,有导入导出功能.你试过了吗?
如果要在c#中执行相同的操作,请按照下列步骤操作:
1)开源(sql)数据库
2)打开或创建目标(访问)数据库
3)对于源代码中的所有表:
3.1)在目标中创建相同的结构(无参考约束)
3.2)将数据从源复制到目标
3.3)在目的地中创建参考约束
4)对于源中的所有视图:
4.1)在目标位置创建视图(可能必须添加一些逻辑,因为您可以引用的功能不相同-这就是为什么SQL Manager中的数据导出是根据视图创建表的原因)
但是,如果您想拥有一个轻量级的嵌入式sql服务器,以便能够与您的应用程序一起部署它,那么最好使用
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[^]


这篇关于如何将.mdf文件转换为.mdb或.accdb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆