Title: MI: error corrected

Thanks who responded to my query. The question was:

Why this gives error:
dim tname as string
dim tobj as alias
tname = layerinfo(frontwindow(),4,1)
tobj = tname+".obj"
Select * from Areatable, tshape where Areatable.Obj Contains tobj into roadinfo
Last line gives error "datatype mismatch in expression". If I use Actual_table_name.obj instead of tobj, it works fine

Solutions 1:
Run Command "Select * from Areatable, tshape where Areatable.Obj contains "+tobj+" into roadinfo"

Solution 2:
Store tname+".obj" in a string variable, then store this string in an alias, then use the alias in the select statement. The alias must come from the build of the string.

Solution 3:
 tobj is defined as an alias and not as an object. MB is not smart enough to see that the alias is defined for the column object when it "compiles" the codes. Add a "dim o as object o=tobj" and use o in the select

Regards
Ken


Reply via email to