简体   繁体   English

无法从Access导入数据到MS SQL Server

[英]Cannot import data from Access to MS SQL Server

I am trying to migrate a vb.NET project from an MS Access database to MS SQL Server, and have been following a tutorial I found here to do so. 我正在尝试将vb.NET项目从MS Access数据库迁移到MS SQL Server,并且一直在按照我在此处找到的教程进行操作。 I did this, but got a problem where I could read data from the SQL Server database when running my project, but could not insert/edit data using the project. 我这样做了,但遇到了一个问题,我在运行项目时可以从SQL Server数据库中读取数据,但是无法使用项目插入/编辑数据。

Any data I tried to manipulate only worked on the Access database, and didn't have any affect on the SQL Server data (I also tried vice-versa, adding data using SQL Server but this couldn't been seen in my project). 我试图操作的任何数据只能在Access数据库上运行,并且对SQL Server数据没有任何影响(我也反过来,使用SQL Server添加数据,但这在我的项目中看不到)。 So I decided to try again, deleting the Access and SQL Server databases, and using the backup database to import the data from. 所以我决定再次尝试,删除Access和SQL Server数据库,并使用备份数据库从中导入数据。 However, this now is not working, and I'm getting the following error message 但是,现在这不起作用,我收到以下错误消息

Error 0xc020801c: Source - ~TMPCLP123581 1 : SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. 错误0xc020801c:源 - ~TMPCLP123581 1 :SSIS错误代码DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER。 The AcquireConnection method call to the connection manager "SourceConnectionOLEDB" failed with error code 0xC0202009. 对连接管理器“SourceConnectionOLEDB”的AcquireConnection方法调用失败,错误代码为0xC0202009。 There may be error messages posted before this with more information on why the AcquireConnection method call failed. 在此之前可能会发布错误消息,其中包含有关AcquireConnection方法调用失败原因的更多信息。 (SQL Server Import and Export Wizard) (SQL Server导入和导出向导)

Exception from HRESULT: 0xC020801C (Microsoft.SqlServer.DTSPipelineWrap) 来自HRESULT的异常:0xC020801C(Microsoft.SqlServer.DTSPipelineWrap)

Does anybody know a fix for this? 有人知道解决这个问题吗? Or why I can no longer import data into SQL Server? 或者为什么我不能再将数据导入SQL Server? (The image below shows the result of what processes were/weren't carried out) (下图显示了未执行的过程的结果)

在此输入图像描述

I've fixed the issue now, guys. 伙计们,我现在已经解决了这个问题。

I migrated it over using Microsoft SQL Server Migration Assistant for Access, and then changed the connection path and settings in my .ini file. 我使用Microsoft SQL Server Migration Assistant for Access迁移它,然后更改了.ini文件中的连接路径和设置。

Then I created a new connection string, using string variables for each of the settings in the .ini file, and this replaced the initial Access database connection string. 然后我创建了一个新的连接字符串,为.ini文件中的每个设置使用字符串变量,这取代了初始的Access数据库连接字符串。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM