将 Access 数据库转换为 SQL Server

发布于 2024-10-05 19:24:40 字数 800 浏览 0 评论 0原文

我已经使用 ASP.NET 和 Access DB 创建了一个应用程序,现在我发现 somee.com 只支持 SQL Server DB,所以现在我必须将 Access DB 转换为 SQL Server DB。

有没有什么工具可以做到这一点?

这是我在 Web 应用程序中使用的一些代码:

Public Shared Function conecter() As OleDbConnection
Dim MyConnexion As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & System.AppDomain.CurrentDomain.BaseDirectory & "/Learning.mdb")
MyConnexion.Open()
Return MyConnexion
End Function

Public Shared Function lecture(ByVal requete As String) As OleDbDataReader
Dim Mycommand As OleDbCommand = conecter().CreateCommand()
Mycommand.CommandText = requete
Dim myReader As OleDbDataReader = Mycommand.ExecuteReader()
Return myReader
End Function

在这种情况下,如果我转换数据库,我必须更改 OleDbConnexion 和其他内容,或者我可以就这样保留它们吗?

I've created an application using ASP.NET with Access DB, now I found somee.com who support only SQL Server DBs, so Now I must convert my Access DB to SQL Server DB.

Is there any tool who can do the trick ?

This is some code I'm using in my web application :

Public Shared Function conecter() As OleDbConnection
Dim MyConnexion As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & System.AppDomain.CurrentDomain.BaseDirectory & "/Learning.mdb")
MyConnexion.Open()
Return MyConnexion
End Function

Public Shared Function lecture(ByVal requete As String) As OleDbDataReader
Dim Mycommand As OleDbCommand = conecter().CreateCommand()
Mycommand.CommandText = requete
Dim myReader As OleDbDataReader = Mycommand.ExecuteReader()
Return myReader
End Function

In this case, If I convert my database I must change the OleDbConnexion and other things or I can just leave them like that ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

瞳孔里扚悲伤 2024-10-12 19:24:40

您的连接字符串将需要更改。如果您在弄清楚如何设置 SQL 连接字符串时遇到问题,Connectionstrings.com 是一个很好的资源。

对于向上迁移,请查看 Access Upsize Wizard - 此链接适用于 2002 年,因为我'我不确定您拥有什么访问版本。

如果由于某种原因您没有足够的权限访问 SQL 数据库来直接处理升级,您可能只需要生成数据库架构并删除一些迁移代码。

Your connection string will need to change. Connectionstrings.com is a good resource for this if you're having problems figuring out how to set up a SQL connection string.

For upward migration, take a look at the Access Upsize Wizard - this link is for 2002 since I'm not sure what access version you have.

If for some reason you do not have sufficient access to your SQL database to handle an upsize directly, you'll likely need to just generate the database schema and knock out a bit of migration code.

孤城病女 2024-10-12 19:24:40

如果您有 Access 2007,则有内置选项将 Access 数据库转换为 SQL,否则有很多免费工具可用。

bullzip 免费转换器

If you have access 2007, there is inbuilt option convert access database to SQL other wise there are somany tools available for free.

bullzip free converter

oО清风挽发oО 2024-10-12 19:24:40

尝试必须

它是由我的一位同事开发的(我们设计了网站:www.upsizing.co.uk )。

它比 MS 工具的功能要多一些。

Try MUST

It was developed by a colleague of mine (we designed the website: www.upsizing.co.uk).

It does a fair bit more than the MS tools.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文