Hello,
> Further to my original query....I thought that perhaps I could get around
> my problem by constructing the command within a string variable and then
> issuing it using the 'Run Command' statement...but no...it seems not.
>
>
> Consider this....
>
>
> Update mytable Set Col18 = newrecord where rowid = selected
>
> works quite fine..which of course you would expect, but....
>
>
> cmd_update="Update mytable Set Col18 = newrecord where rowid =
> selected"
>
> Run Command cmd_update
>
>
> produces an error stating that 'Variable or field newrecord is not
> defined'. I can assure that the variable newrecord is indeed defined...of
> course the first example wouldn't work were it not.
>
>
> Now...I'm sure that I'm probably missing something quite fundamental
> here, but I'm afraid I'm going to need someone to point it out to me.
MapInfo does not know that your MapBasic application defines variable
newrecord. You have to put its value into the command that you are
running in MapInfo using Run Command:
cmd_update = "Update mytable Set Col18 = " + newrecord + " where rowid = " + selected
I assume that selected is a variable also. Note that if newrecord is string variable
and Col18
is string column, you have to enclose newrecord into double quotes:
cmd_update = "Update mytable Set Col18 = """ + newrecord + """ where rowid = " +
selected
Dmitry
Dmitry Bogdanov
GIS Department Manager
Kiev Software Factory Ltd.
room 46 9/12 Baumana St, Kiev, Ukraine 252190
Tel: (380 44) 442-6077; (380 44) 443-7925
Fax: (380 44) 443-7925
Internet: http://www.ksf.kiev.ua
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]