Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Execute an SQL statement that is stored in a String?
Message
De
24/10/1999 16:13:12
 
 
À
23/10/1999 21:29:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00280480
Message ID:
00280645
Vues:
10
Hi Mauricio

What Barbara mentioned about the 254 characters is true. If your queries are long you are going to run into trouble unless you string together several macro's.

If your queries are going to be this long, another solution for you to consider is to use the strtofile() and filetostr() functions. Here you can just keep adding the properly formatted text that makes up the query to one file. When you are ready to execute use the filetostr() function, and then delete the file.




>I want to let the users choose from a lot of options in a Form, then, based on that options, my aplication build an SQL statement and store it in a String.
>
>Something like this:
>
>sStatement = "SELECT * FROM " + Combo1.Value + " ORDER BY " + Combo2.Value
>
>
>Actually I create more complicated Querys, but that´s the idea.
>
>I do not want to create a fixed Query for all the 130 diferent combinatios that the user can choose from, so I need to do something like that.
>
>As you can see, not only the variables values are going to change, also the table names and field names will.
>
>I`m using a local Database
>
>
>Thanks in advance
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform