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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linked foxpro tables

Status
Not open for further replies.

redlam

MIS
Jun 28, 2000
218
US
I have a SQL2000 server which has a FoxPro linked server named Fox_link. I am trying to execute queries against these foxpro tables from Query Analyzer but I can't seem to make them work. Books Online indicates that I need a fully qualified table name including the linked server name, catalog, schema and table name. The values of these are as follows:
ServerName: Fox_link
Catalog: h:\Data
Schema: NULL
TableName: TCDates

Can anyone help me with a simple update syntax that would work on this linked server? Here's a sample of something that obviously won't work:

Update Fox_link.h:\Data.NULL.TCDates
Set DateFrom = '01/01/01'

Thank you!
 
Does the table TCDates belong to a FoxPro database? In Visual FoxPro 3.0 and later, a table (.DBF) can optionally belong to a database (.DBC). Robert Bradley
Support operation moo!
Visit the OpCow page to help in this cause
 
Hi there.
The table TCDates does not belong to a database. It is a free table - although there are other linked servers that are Visual FoxPro 6.0 databases. Is there anyway to update the data in these tables using query analyzer?
Thanks much.
 
Did you ever solve this problem? I'm trying to do the same thing, connect FoxProx Free Table directory with SQL and I can't get it to work.

If you have any suggestions, I'd love to hear them.

Thanks,

pcawdron@gmac.com.au
 
Hi there.
I'm not sure if I solved the problem or simply created a work around but I changed the query to look like this:

update openquery(foxtables, 'select tcid, tcdates from tcalendar')
set tcdates = '01/01/01'

Here's more info on the OpenQuery command:
OPENQUERY
Executes the specified pass-through query on the given linked server, which is an OLE DB data source. The OPENQUERY function can be referenced in the FROM clause of a query as though it is a table name. The OPENQUERY function can also be referenced as the target table of an INSERT, UPDATE, or DELETE statement, subject to the capabilities of the OLE DB provider. Although the query may return multiple result sets, OPENQUERY returns only the first one.

Syntax
OPENQUERY ( linked_server , 'query' )

Arguments
linked_server
Is an identifier representing the name of the linked server.

'query'
Is the query string executed in the linked server.


Hope this helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top