使用过程从SQL Connection从Access获取数据 [英] getting data from Access by SQL Connection by using Procedure

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

问题描述

我尝试通过使用SQL过程将访问表中的数据获取到Sql
这是我使用的代码

i try to get the data from an access table to Sql by using SQL Procedures
and this is the code i used it

EXEC sp_addlinkedserver
@server = ''ADBS'',
@provider = ''Microsoft.Jet.OLEDB.4.0'',
@srvproduct = ''OLE DB Provider for Jet'',
@datasrc = ''C:\good\Manager.mdb''






and

create view  m3 as
Select * FROM OPENQUERY(ADBS, ''SELECT * FROM DPICrosses'')




但是这个错误就要来了
链接服务器"ADBS"的OLE DB访问接口"Microsoft.Jet.OLEDB.4.0"返回消息找不到文件"C:\ good \ Manager.mdf"
消息7303,第16级,状态1,过程m3,第2行
有谁能帮我解决这个问题..?
感谢




but this error is coming
OLE DB provider "Microsoft.Jet.OLEDB.4.0'' for linked server'' ADBS'' returned message "Could not find file ''C:\good\Manager.mdf''
Msg 7303, Level 16, State 1, Procedure m3, Line 2
can any one help me in solving that..?
thanks

推荐答案

错误明确指出文件在给定位置不存在.

我看到您正在链接两个系统,然后尝试访问数据.您需要在ADBS系统上提供适当的访问权限,以便文件可以公开和访问.可能是您需要共享它并允许您的其他系统访问.共享后,请使用共享时获得的相对路径,而不是在ADBS上使用文件的绝对路径.可能是"\\ ADBS \ Good \ Manager.mdb"之类的东西,请在使用前确保它是什么.

目前,在运行这些查询的系统(位于C:位置)上,您的MDB文件应该是正确的,因此是错误的.
Error clearly states that the files does not exists at the given location.

I see you are linking the two systems and then trying to access data. You need to provide proper access on ADBS system such that the file is exposed and accessible. Might be you need to share it and allow your other system to access. Once shared, instead of using absolute path of file on ADBS, use the relative path that you get on sharing. May be something like, "\\ADBS\Good\Manager.mdb", make sure what it would be before using.

For now, your MDB file is being expected on the system (at C: location) where you run these queries which is not correct and hence the error.


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

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