Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unusual occurance on runtime configuration
Message
 
To
08/11/2002 09:26:35
General information
Forum:
Visual FoxPro
Category:
Installation, Setup and Configuration
Miscellaneous
Thread ID:
00720164
Message ID:
00720270
Views:
9
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform