Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Use VFP cursor IN SPT query?
Message
De
16/09/2002 19:44:50
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00699905
Message ID:
00701041
Vues:
31
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform