John wrote:
I have a mapbasic program that gets an SQL statement from the user filling
in a
text box. This statement is stored in a string variable and the program
runs
the select statement once the dialog is dismissed with OK. Eg:
if commandinfo (CMD_INFO_DLG_OK) then
Select * From tables Where wherestatement Into Selection
end if
the variable "tables" and "wherestatement" hold the user input table names
and
SQL where statement respectively.
currently this doesn't work!
*******************************
I guess if you run the Select like this, it will be more likely to work:
...
if commandinfo (CMD_INFO_DLG_OK) then
Run Command "Select * From " + tables + " Where " + wherestatement + "
Into Selection"
end if
or what I prefer:
...
Dim szCmdStr As String
...
if commandinfo (CMD_INFO_DLG_OK) then
szCmdStr = "Select * From " + tables + " Where " + wherestatement + "
Into Selection"
Print szCmdStr ' Printing the string to the message window, it's
wonderfull to see what actually is being asked for ; )
Run Command szCmdStr
end if
I hope this helps you !
Best regards
Peter
***************************************************************************
*
Peter Moller [EMAIL PROTECTED]
GIS-Developer Direct: +45 6313 5008
Kampsax Geoplan Voice: +45 6313 5013
Rug�rdsvej 55 Faximile: +45 6313 5090
DK 5000 Odense C Web: www.mapinfo.dk
MapInfo Authorized Partner
***************************************************************************
*
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]