Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
About SQL syntax and compiling (URGENT)
Message
De
21/01/2001 19:23:07
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00466414
Message ID:
00466417
Vues:
14
Hello, Kosta,

You can try the following:

1. First of all, you'll need a method to validate the strings, because the user doesn't select anything in one combo, the resulting command will be something like and this will blow up the sql command.
So: create a custom method in the form (menu Form, New Method), named MyMethod or something.

The code in the method:
LPARAMETERS condition,value
IF value == '' OR value = 'ALL'
    sqlstring = ''
ELSE
    sqltring = 'AND ' + condition + ' = ' + value
ENDIF
RETURN sqlstring
The 'Save' button in the form (or Search or how do you name it) should have something like that in the Click's event:
sqlcommand = 'SELECT * FROM mydata WHERE ' + ;
    Thisform.MyMethod('mydata.scholltype',Thisform.Combo1.Value) + ;
    Thisform.MyMethod('mydata.city',Thisform.Combo1.Value) + ;
........... and so on, until they're finished ............
    'INTO Cursor MyResult NOFILTER'
2. Somewhere in the beginning of the main program place the line
_screen.WindowState = 2
Hope this helps.
Grigore Dolghin
Class Software.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform