从访问mdb文件中检索数据并插入到sql server。如何使用查询执行此操作 [英] retrieve data from access mdb file and insert into sql server .how to do this using query

查看:116
本文介绍了从访问mdb文件中检索数据并插入到sql server。如何使用查询执行此操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从访问mdb文件中检索数据并插入到sql server。如何使用query或t-sql执行此操作。

解决方案





由于Microsoft Access和Sql Server属于单一家庭Microsoft,因此您可以轻松完成。

试试这个link [ ^ ]。

我希望这对你有所帮助。



问候,

RK

   -   检查是否安装了驱动程序打开ODBC数据源管理员(开始>运行>键入ODBCAD32.EXE并按Enter键)并在驱动程序选项卡下检查 
SET < span class =code-keyword> NOCOUNT ON ;

执行 sp_configure ' show高级选项' 1 ;
RECONFIGURE ;
GO

执行 sp_configure ' Ad Hoc Distributed Queries' 1 ;
RECONFIGURE ;
GO

SELECT *
FROM OPENDATASOURCE ' Microsoft.Jet.OLEDB.4.0'' Data Source = C:\ AddressBook。 mdb')... [tblContacts]

- SELECT [Field1 ],[Field2],[Field3],[Field4]
- FROM OPENDATASOURCE( 'Microsoft.Jet.OLEDB.4.0','数据源=位置:\文件名.mdb')... [TableName]

Exec sp_configure ' Ad Hoc Distributed Queries' 0 ;
RECONFIGURE ;
GO

执行 sp_configure ' 显示高级选项' 0
RECONFIGURE ;
GO


retrieve data from access mdb file and insert into sql server .how to do this using query or t-sql.

解决方案

Hi,

Since Microsoft Access and Sql Server is under single family Microsoft you can do it with ease.
Try this link[^].
I hope this could help you a bit.

Regards,
RK


--To check the driver is installed or not open ODBC Data Source Administrator (Start > Run > type ODBCAD32.EXE and hit enter) and check under the Drivers tab
SET NOCOUNT ON;

Exec sp_configure 'show advanced options', 1;
RECONFIGURE;
GO

Exec sp_configure 'Ad Hoc Distributed Queries', 1;
RECONFIGURE;
GO

SELECT *
FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0','Data Source=C:\AddressBook.mdb')...[tblContacts]

--SELECT [Field1],[Field2],[Field3],[Field4]
--FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0','Data Source=Location:\Filename.mdb')...[TableName]

Exec sp_configure 'Ad Hoc Distributed Queries', 0;
RECONFIGURE;
GO

Exec sp_configure 'show advanced options', 0
RECONFIGURE;
GO


这篇关于从访问mdb文件中检索数据并插入到sql server。如何使用查询执行此操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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