Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unusual occurance on runtime configuration
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Installation et configuration
Divers
Thread ID:
00720164
Message ID:
00720270
Vues:
10
>thisform.grid2.recordsource = MySQL + MyWhere + " into table " + cLocalPath + "Temp"

WOW! This is a really bizarre way of creating a table. I'm surprised it does work sometimes...

The recordsource property can hold the alias name of a cursor, the name of a table, the name of a query file (QPR), or an SQL expression (I assume you are using this setting of the RecordSourceType property)

In any case, it is intended as a reference to an existing cursor, or to a query expression which may retrieve the data. Placing "action" SQL commands there (i.e. SELECT INTO..., or INSERT INTO ... etc) may have unpredictable results: when / how many times / with which error handling, is the command executed?

By all means, the right way to do this (in my opinion) should be:
* Your code to assign MySql and MyWhere goes here

* Create the temp table (right once, and right now)
lcCommand = MySQL + MyWhere + " into table " + cLocalPath + "Temp"
&lcCommand

* Assign grid recordsource property
thisform.grid2.recordsource = cLocalPath + "Temp"
Try this, it should work. Even if it doesn't, i.e. because the path does not exist, you'll get an "nice and fixable" error in the &lcCommand line!

Hope this helps,
Jose.
------------------
Jose Marcenaro
Tercer Planeta - Argentina
http://www.tercerplaneta.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform