如何在.NET中将SDF转换为MDB [英] How to convert SDF to MDB in .NET

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

问题描述

嗨!

我需要将数据从Compact SQL文件(sdf)读取到Access .mdb.我设置了对System.Data.SqlServerCe的引用.这是我正在使用的代码,但我得到的是:在连接字符串或IN子句中未指定数据库."

子Main()
昏暗的AccessConn作为新的System.Data.OleDb.OleDbConnection("Provider = Microsoft.Jet.OLEDB.4.0; Data Source = MyResultFile.mdb")

AccessConn.Open()

昏暗的AccessCommand作为新的System.Data.OleDb.OleDbCommand(String.Format("SELECT * INTO [MyTable] FROM [MyTable] IN''''{0}","[Provider = Microsoft.SQLSERVER.CE.OLEDB.3.5 ; Data Source = MySourceFile.sdf;最大缓冲区大小= 1024;最大数据库大小= 1000; Persist Security Info = False;];),AccessConn)

AccessCommand.ExecuteNonQuery()
AccessConn.Close()

结束子

当我用数据库"替换数据源"时,我得到的是找不到可安装的ISAM."

谁能帮忙吗?

问候.

Hi!

I need to read the data from Compact SQL file (sdf) to Access .mdb. I set reference to System.Data.SqlServerCe. Here is the code that I''m using, but I''m getting: "No database specified in connection string or IN clause."

Sub Main()
Dim AccessConn As New System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=MyResultFile.mdb")

AccessConn.Open()

Dim AccessCommand As New System.Data.OleDb.OleDbCommand(String.Format("SELECT * INTO [MyTable] FROM [MyTable] IN '''' {0}", "[Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5;Data Source=MySourceFile.sdf;Max Buffer Size=1024;Max Database Size = 1000;Persist Security Info=False;];"), AccessConn)

AccessCommand.ExecuteNonQuery()
AccessConn.Close()

End Sub

When I replace "Data Source" with "DataBase" I''m getting "Could not find installable ISAM."

Could anyone please help?

Regards.

推荐答案

,您可以使用第三方商业应用程序http://www.dbnetcopy.com/,该应用程序将在SQL Server Compact和大多数其他主要数据库之间复制数据.供应商.对于非许可版本,每张表限制为1000条记录.

希望对您有帮助
you can use a third party commercial application http://www.dbnetcopy.com/ that will copy data between SQL Server Compact and most other major database vendors. Limited to 1000 records per table for the non-licensed version.

Hope this will help you


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

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