Ben
Ben

Reputation: 47

SQL Msg 7303, Level 16, State 1, Line 3 Cannot initialize the data source object of OLE DB provider "VFPOLEDB"

I have a 32bit SQL Server 2014 Express (BenVM) set up on a virtual machine running Windows 7 64bit. This instance of SQL Server has a linked server connected to it called MSCRIBE2 using the VFPOLEDB (foxpro) provider. From my virtual machine I am able to use openquery to query my linked server.

I also have a local machine (Windows 10 64bit) which also has 32bit SQL Server 2014 Express set up on it (BenLocal). This instance of SQL Server has a linked server connected to it called MSCRIBE using the VFPOLEDB (foxpro) provider. From my local machine I am able to use openquery to query my linked server.

From my local machine I am able to connect to the SQL Server instance running on my virtual machine (BenVM) and query native tables, however when I try to run the exact same query that worked when logged directly into my VM I get the following error:

OLE DB provider "VFPOLEDB" for linked server "MSCRIBE2" returned message "Invalid path or file name."

Msg 7303, Level 16, State 1, Line 3
Cannot initialize the data source object of OLE DB provider "VFPOLEDB" for linked server "MSCRIBE2"

I have tried using both windows authentication and a SQL User as my login for BenVM from my local machine, however this does not seem to matter. I have also tried both a Local Service and a Named Account as the "Log On" for the SQL Server running on my VM but this did not seem to help either.

Both of the linked servers MSCRIBE and MSCRIBE2 point to the exact same network resource to which i have full read/write permissions. and I am not using a mapped drive address rather \\\ServerName\Folder

The query being used is

Select * from openquery(MSCRIBE2, '
Select ORDER.DATE,ORDER.ORDERNR
    from [ORDER]
    where cast(ORDER.DATE as date) = {^2018-03-08}
')

I would appreciate any help.

**** Update It looks like the issue is directly related to my openquery above, I did not try this earlier but just now I tried it as a regular query and I was able to connect. The query I used now is:

    Select [ORDER].[DATE],[ORDER].[ORDERNR]
    from MSCRIBE2...[ORDER]
    where cast([ORDER].[DATE] as date) = '2018-03-08'

Upvotes: 1

Views: 4234

Answers (1)

Cetin Basoz
Cetin Basoz

Reputation: 23797

I believe the issue is in security. In either case, I would double check if I am doing the call with an 32 bits driver (ie: a C# code compiles to 64 bits on a 64 bits machine unless explicitly targeted x86). With OpenQuery, would you at least try giving the full path instead of just table name (like " ... from ([c:\My Folder\Order]) ).

Upvotes: 1

Related Questions