Neal,

I think your problem lies in the "_" part of the variable.  There seems to
be an issue with sending strings as part of a variable in a select command.
Try the following instead:

Define a string variable called cmdstr,

cmdstr = "Select * from _" + dmaTableName + ", " + Zip_without_pts + " where
_" + dmaTableName.Obj +
                " Contains Part " + Zip_without_pts + ".Obj into Selection"
Run Command cmdstr

You may need to fiddle about with the way you concatenate the string
command.

Hope this helps
--
Regards
Colin Henderson
Associate GIS Analyst
WFI Consulting
Tel: +44 (0)1483 400937
Fax: +44 (0)1483 400
Mobile: +44 (0)7887 638771
[EMAIL PROTECTED]


-----Original Message-----
From: Niemiec, Neal [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 21, 2001 10:49
To: '[EMAIL PROTECTED]'
Subject: MI-L 


This should be simple, but I keep getting a unrecognized command error. I am
trying to run a simple SQL operation using two table. One of them is
referenced by a variable which I assume is the problem. Can anyone look at
it and let me know what I am doing wrong? It is the last line of the script.

Thanks, NEAL

'
'This is a mapping program to create DMA maps with Cable Provider,
'and Zip Code information for the Marketing department 3-21-01
'
'
'------------------------------------------------------------
'VARIABLES
'------------------------------------------------------------
Dim i_dma As SmallInt
Dim dmaTableName As String
Dim zipTableName As String
'-------------------------------------------------------------
'GET USER INPUT
'-------------------------------------------------------------
Dialog
        Title "DMA Map Script 1.1"
Control StaticText
        Title "Enter DMA #"
Control EditText
        Value "###"
        into i_dma
Control OKButton
        Title "Proceed"
        position 50, 50 width 40
'-------------------------------------------------------------
'OPEN DMA TABLE
Open Table "M:\Projects\DMA Maps 3-21-01\Shapefiles\Dma0001.TAB"
Map From Dma0001
'---------------------------------------------------------------------------
---------------------------------------------
'SELECT DMANUM
select * from Dma0001 where DMANUM = i_dma into Selection
'---------------------------------------------------------------------------
---------------------------------------------
' SAVE DMA BOUNDARY FILE
dmaTableName = i_dma + "dma"
Commit Table Selection As "M:\Projects\DMA Maps
3-21-01\Shapefiles\"+dmaTableName
'---------------------------------------------------------------------------
-----------------------------------------------
' CLOSE ALL TABLES
Close All Interactive
'---------------------------------------------------------------------------
-----------------------------------------------
' OPEN SELECT DMA TABLE
Open Table "M:\Projects\DMA Maps 3-21-01\Shapefiles\"+dmaTableName
Map From "_"+dmaTableName
'---------------------------------------------------------------------------
-----------------------------------------------
' OPEN ZIP CODE FILE
Open Table "M:\Projects\DMA Maps 3-21-01\Shapefiles\Zip_without_pts.TAB"
Interactive
Map From Zip_without_pts
'-------------------------------------------------------------
'CONTAINS PART OPERATION / ON DMA AND ZIPCODE FILES
Select * from "_"+dmaTableName, Zip_without_pts where "_"+dmaTableName.Obj
Contains Part Zip_without_pts.Obj into Selection


NEAL T. NIEMIEC
GIS DEVELOPER SPECIALIST
(303) 723-3162

ECHOSTAR @ RIVERFRONT OFFICE
5701 S.Santa Fe
Littleton, CO 80120





_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.



_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.

Reply via email to