Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Use VFP cursor IN SPT query?
Message
From
16/09/2002 19:44:50
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00699905
Message ID:
00701041
Views:
29
Lynda,

>OpenRowSet() and perhaps even OpenQuery() appear to have possibilities, if

Here is an example for you. It may be easiest if you just copy the following into Query Analyzer and try it out.

SELECT * INTO #curEmployee
FROM
OPENROWSET('MSDASQL','DRIVER=Microsoft FoxPro VFP Driver (*.dbf);SourceType=DBF;
SourceDB=C:\Program Files\Microsoft Visual FoxPro 7\Samples\Data;Exclusive=No;Deleted=No;BackgroundFetch=No',
'SELECT * FROM Employee')

select emp_id,last_name,first_name from #curEmployee order by last_name

DROP TABLE #curEmployee

Notes :
I'm doing this with a free table by specifying Sourcetype=DBF and giving a path in the SourceDB. You can use a DBC also by specifing Sourcetype=DBC and then naming the DBC in the SourceDB.

The path you use in SourceDB must be available from your SQL server. UNCs are allowable.

If you have to pass parameters to be used in the 'SELECT * FROM Employee' statement, there seems to be some tricks to that as well. I could give you an example if you decide to go this route.

Good luck,
Anthony
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform