Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL 101 (again)
Message
De
22/07/2002 17:18:20
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00681356
Message ID:
00681368
Vues:
23
>Hi,
>
>Can anyone help me with a SQL query I am sending through SQLexec on an ACCESS database:
>I want the filter records that belong to employees selected. The selected set of employees is represented in a VFP cursor {SELECTED} or a comma-delimited string containing their IDs {cSelectedIDs}:
>
>nSuccess=SQLexec(nFileHandle,'select * from ACCESSTABLE where ????????','RESULT')
>
>I would like to do the equivalent either VFP for clauses:
>1. for !eof('SELECTED') && A relationship is set into SELECTED
>2. for at(EMPID,cSelectedIDs)>0

First, SQLEXEC() is sending a command to Access to be processed. Access knows nothing about the VFP environment that has sent the command and it has no way to "access" your VFP cursor. You have to do it either all in Access, or all in VFP:

- if in Access, you will probably need to build the SQL SELECT string, perhaps using an IN clause: WHERE AccessEmpIDColumn IN (literal string of values built from your cSelectedIDs memvar)

- if in VFP, you could pull all the info into a VFP cursor with SELECT *, then do another SELECT locally with the two local cursors. The first SELECT * is probably going to be inefficient, though.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform