John,

MB will parse 'wherestatement' as a single 'token' or 'word' - which isn't
what you want.  You will probably be best off using the 'Run Command'
statement something like this:

        Run Command "Select * From " & tables & " Where " & wherestatement &
" Into Selection"

'Run Command' causes the subsequent string to be parsed into its individual
tokens before being executed.

Richard Burkmar
ICL

-----Original Message-----
From: "fannon_j"@wrcplc.co.uk [mailto:"fannon_j"@wrcplc.co.uk]
Sent: 21 December 1999 09:14
To: [EMAIL PROTECTED]
Subject: MI MapBasic - SELECT command problems




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!


The variable "tables" seems to be ok.......but there is something about
using a
string variable for the where part of the statement which MapBasic doesn't
like.
Do I need to split up the wherestatement string variable into seperate
string
variables for the SELECT command to work?  Or is it something to do with
column
aliases (which I hate!) ?

If you have any ideas I'd be happy to here them!

cheers

John


----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to