从SQL Server 2005的Access数据库表中获取数据 [英] Gettint the data from an Access data base table from SQL Server 2005

查看:87
本文介绍了从SQL Server 2005的Access数据库表中获取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

伙计们
我有一个可访问的表,我想使用来自Sql2005的查询从该表中获取数据,我发现我应该创建一个服务器,并且这样做,但是当我尝试获取数据时出现错误,这是代码

hi guys
i have a table in access and i want to get the data from this table using a query from Sql2005 and i found that i should create a server and i do that but an error come from when i trying to get the data and this is the code

EXEC sp_addlinkedserver
@server = ''AccessDB'',
@provider = ''Microsoft.Jet.OLEDB.4.0'',
@srvproduct = ''OLE DB Provider for Jet'',
@datasrc = ''C:\Path\to\Access\Database.mdb''
GO



......



...............

<pre lang="sql">
SELECT *
FROM OPENQUERY(AccessDB,''SELECT * FROM DPI Crosses'')





错误是





the error is

OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "AccessDB" returned message "'C:\Path\to\Access\Database.mdb' is not a valid path.  Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "AccessDB".

推荐答案

您是否已安装MS Access?路径正确吗?

从MSDN帮助:请在此页面的中途浏览 [
Do you have MS Access installed? Is the path correct?

FROM MSDN HELP: SEE half way down in this page[^]

This example assumes that both Microsoft Access and the sample Northwind database are installed and that the Northwind database resides in C:\Msoffice\Access\Samples.<br />


这篇关于从SQL Server 2005的Access数据库表中获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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