Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Openrowset and a Visual Foxpro dbf

Status
Not open for further replies.

seekwall

Programmer
May 14, 2001
41
0
0
GB
I am trying to run a simple selection of a Visual Foxpro Table, from SQL Server using the following:-

select a.*
from openrowset('MSDASQL',
'DRIVER={Microsoft Visual FoxPro Driver};
SourceDb = c:\<path>\; SourceType=DBF;',
'SELECT top 10 field1 FROM table ORDER BY 1 ') as a

The .dbf in question has been copied from it's container database and placed on a seperate server.

When trying to run the query, I get the follwing error message:

Server: Msg 7399, Level 16, State 1, Line 2
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [Microsoft][ODBC Visual FoxPro Driver]Cannot open file c:\<path>\<database>.dbc.]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IColumnsInfo::GetColumnsInfo returned 0x80004005: ].

Can anyone help me out with this ?
 
You can't copy table that was a part of database direcly to another location,
because it has in it header link to the database.
So first you must in VFP use FREE TABLE TableName command to
remove a database reference from a table.

Than it will work.

Also, about FREE TABLE command you can ask in Visual Foxpro forum forum184


Zhavic

---------------------------------------------------------------
In the 1960s you needed the power of two Comodore64s to get a rocket to the moon. Now you need a machine which is a vast number of times more powerful just to run the most popular GUI.
 
Yeah... I realised that after the fact.

Bring back Fox 2.6 is what I say

Thanks anyway
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top