Showing posts with label openrowset. Show all posts
Showing posts with label openrowset. Show all posts

Monday, February 20, 2012

Linked Server to DBC Data

Hi All,
I'm having trouble setting up a linked server OR using an OpenRowset operati
on from SQL Server against once of the DBC files from one of our vendors.
I can get connected through a DSN using Microsoft Access without trouble but
when trying to set up a linked server on the same DSN I get the following e
rror...
****************************************
**************************
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [Microsoft][ODBC Driver Manag
er] Driver's SQLSetConnectAttr failed]
[OLE/DB provider returned message: [Microsoft][ODBC Driver Manag
er] Driver's SQLSetConnectAttr failed]
[OLE/DB provider returned message: [Microsoft][ODBC Visual FoxPr
o Driver]Cannot open file c:\data\MyDB.dbc.]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IDBInitialize::Initialize
returned 0x80004005: ].
****************************************
**************************
Can someone advise?
Thanks!
TravisSorry, for clarification, a DBC file is a FoxPro Data file.
"REM7600" <rem7600@.hotmail.com> wrote in message news:%23mkG6JLiGHA.4044@.TK2
MSFTNGP03.phx.gbl...
Hi All,
I'm having trouble setting up a linked server OR using an OpenRowset operati
on from SQL Server against once of the DBC files from one of our vendors.
I can get connected through a DSN using Microsoft Access without trouble but
when trying to set up a linked server on the same DSN I get the following e
rror...
****************************************
**************************
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [Microsoft][ODBC Driver Manag
er] Driver's SQLSetConnectAttr failed]
[OLE/DB provider returned message: [Microsoft][ODBC Driver Manag
er] Driver's SQLSetConnectAttr failed]
[OLE/DB provider returned message: [Microsoft][ODBC Visual FoxPr
o Driver]Cannot open file c:\data\MyDB.dbc.]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IDBInitialize::Initialize
returned 0x80004005: ].
****************************************
**************************
Can someone advise?
Thanks!
Travis|||Hi Travis,
You haven't posted which version of SQL Server you are using or the code
you're using in the OpenRowset statement.
First, be sure you have the latest FoxPro and Visual FoxPro OLE DB data
provider, downloadable from msdn.microsoft.com/vfoxpro/downloads/updates.
I've successfully set up linked servers with code like this:
EXEC master.dbo.sp_addlinkedserver
@.server = N'VFP_Northwind',
@.srvproduct=N'Microsoft Visual FoxPro OLE DB Data Provider',
@.provider=N'VFPOLEDB',
@.datasrc=N'C:\Program Files\Microsoft Visual FoxPro
9\Samples\Northwind\Northwind.dbc',
@.provstr=N'VFPOLEDB.1'
After that you can access data with the four-part naming convention:
Select * From VFP_Northwind...Customers
Cindy Winegarden MCSD, Microsoft Most Valuable Professional
cindy@.cindywinegarden.com
"REM7600" <rem7600@.hotmail.com> wrote in message
news:%23mkG6JLiGHA.4044@.TK2MSFTNGP03.phx.gbl...
Hi All,
I'm having trouble setting up a linked server OR using an OpenRowset
operation from SQL Server against once of the DBC files from one of our
vendors.
I can get connected through a DSN using Microsoft Access without trouble but
when trying to set up a linked server on the same DSN I get the following
error...
****************************************
**************************
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [Microsoft][ODBC Driver Manag
er] Driver's
SQLSetConnectAttr failed]
[OLE/DB provider returned message: [Microsoft][ODBC Driver Manag
er] Driver's
SQLSetConnectAttr failed]
[OLE/DB provider returned message: [Microsoft][ODBC Visual FoxPr
o
Driver]Cannot open file c:\data\MyDB.dbc.]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IDBInitialize::Initialize
returned 0x80004005: ].
****************************************
**************************|||Cindy,
Thanks for the reply... I've definitely seen your name a time or two around
the web in my search. As it turns out, I believe it to be related to
security. And how our network (Linux/Samba based shares) handles
authentication. I could be wrong but I've given up... Locally I can make
it work fine, on a share NO GO...
Regardless, I've taken a different direction on the solution and it looks
like I'm going to be able to come out with my "goaled for" end result.
Thanks for the reply.
TR

> you're using in the OpenRowset statement.
> First, be sure you have the latest FoxPro and Visual FoxPro OLE DB data
> provider, downloadable from msdn.microsoft.com/vfoxpro/downloads/updates.
> I've successfully set up linked servers with code like this:
> EXEC master.dbo.sp_addlinkedserver
> @.server = N'VFP_Northwind',
> @.srvproduct=N'Microsoft Visual FoxPro OLE DB Data Provider',
> @.provider=N'VFPOLEDB',
> @.datasrc=N'C:\Program Files\Microsoft Visual FoxPro
> 9\Samples\Northwind\Northwind.dbc',
> @.provstr=N'VFPOLEDB.1'
>

Linked Server to DBASE 5 Tables

I am trying to create a linked server to some dbase 5 tables. I have read several other posts about using the OPENROWSET option and that does work however, I would like to be able to create a linked server for easier access.

End Goal: I am developing an ASP based app that needs to join a DB5 table to a SQL table.

Any help on the linked server properties in Enterprise Manager for dbase5 or on the proper sp_addlinkedserver function for dbase5 would be highly appreciated.

JoeCan't you use DTS to get the data from DBase5.|||I have pulled the tables in with a DTS package very easily however, I would like to be able to access the data real time in it's current place. for example:

Select sqltable.Name, dbasetable.BillCharges
From sqltable
Inner Join database...dbasetable On
sqltable.AcctNum = dbasetable.AcctNum

--------------------
By using an example in one of these forums I do have another work around:

SELECT sqltable.Name, dbasetable.BillCharges
FROM OPENROWSET('MSDASQL','DRIVER={Microsoft Dbase driver(*.dbf)}' ,'SELECT Name, AcctNum FROM \\Server\Data\dbasetable.dbf') dBase
Inner Join sqltable On
sqltable.AcctNum = dbase.AcctNum

But this is a little too slow for an asp application.

Thanks for the reply ....