Mehmet - 

If you know the number of subclauses that your query will produce then you
can control the complexity of your expression. In your case, the A =
rst2.RecordCount line gives you the answer. If A is greater than 30 then you
need to break the query up eg (this is a description not code - I can't give
you code - no time, sorry)

a = myrecordcount
if a > 30 then booleanSomeLeft = true
        for i = 1 to 30 
                build up my expression
        next
        run my expression
        Append the results into a separate MapInfo table
end if

Do while  booleanSomeLeft = true
                Retrieve the next set of conditions using my value for A  &
build up the expression
                Run the query
                Append the results into a separate MapInfo table
                booleanSomeLeft = (I've still got some conditions not
processed)
end do

Commit my separate MapInfo table

Paul Crisp


-----Original Message-----
From: Mehmet ALKAN [mailto:[EMAIL PROTECTED]
Sent: 19 January 2004 13:14
To: CRISP, Paul -Syntegra UK
Subject: Re: MI-L Error on MapInfo-Vbasic


Hello,
You say :
You can monitor the expression complexity by counting the number of times
you
loop - if you have too many, then run the query in multiple parts and append
the results together. (in your code test A = rst2.RecordCount)
Best way to do this is set up a new empty table and append the query results
to that for each loop

I dont know what can I do?
Please give an example.

Thanks.
Mehmet ALKAN

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 19, 2004 12:02 PM
Subject: RE: MI-L Error on MapInfo-Vbasic


Mehmet

The problem is as the error message describes - MapInfo is not a RDBMS and
cannot handle the same number of subclauses in a SQL statement as say Access
or Oracle.

You can monitor the expression complexity by counting the number of times
you
loop - if you have too many, then run the query in multiple parts and append
the results together. (in your code test A = rst2.RecordCount)

Best way to do this is set up a new empty table and append the query results
to that for each loop

Rgds

Paul Crisp


-----Original Message-----
From: Mehmet ALKAN [mailto:[EMAIL PROTECTED]
Sent: 17 January 2004 15:16
To: [EMAIL PROTECTED]
Subject: MI-L Error on MapInfo-Vbasic


Hello,

I have a question.

I connect via Vbasic(VB) to MapInfo (MI). First one connect Access and read
a parcelno. And then,
this parcelno to equalize from MapInfo parcelno. As a Result, I draw graphic
data on a frame object. (The code under below)

I show row (error in the parenthesis) , there is no problem up to 30 data
number(30 parcel
number). But if the too much 30,
VB give a    "Expiression too complex" at a blue code row.

What can I do?
Thanks.
Mehmet ALKAN

Private Sub Command7_Click()
Dim A, c(250), T As String

cnn.Open "TEZ_VT"

With cmd2
    .CommandType = adCmdText
    .CommandText = " SELECT Parcel.ParcelNo " & _
                   " FROM Parcel " & _

    Set .ActiveConnection = cnn
End With

With rst2
    .CursorType = adOpenStatic
    .LockType = adLockOptimistic
    .Open cmd2
End With

A = rst2.RecordCount
rst2.MoveFirst

For i = 1 To A
    Text1.Text = rst2.Fields("ParcelNo")
    c(i) = Text1.Text
    rst2.MoveNext
Next i

Set mi = CreateObject("MapInfo.application")
mi.do "Open Table "" D:\VB\uyg "" Interactive  Map From uyg"
mi.runmenucommand 1702
mi.do "Create Menu ""MapperShortcut"" ID 17 as ""(-"" "
T = ""

For i = 1 To A
T = T + Chr$(34) & c(i) & Chr$(34) & ","
Next i

T = Left(T, Len(T) - 1) ' sondaki virgulu atmak icin


mi.do "select* from uyg where TASINMAZNO = any(" & T & ") into selparsel"
("Expiression too complex")


mi.do "Set Application Window " & Frame1.hWnd
mi.do "Set Next Document Parent " & Frame1.hWnd & " Style 1"
mi.do "Map From selparsel "
mi.do " Set Map zoom entire layer selparsel"

End Sub



********************************************************************

This email may contain information which is privileged or confidential. If
you are not the intended recipient of this email, please notify the sender
immediately and delete it without reading, copying, storing, forwarding or
disclosing its contents to any other person
Thank you

Check us out at http://www.syntegra.com

********************************************************************






********************************************************************

This email may contain information which is privileged or confidential. If you are not 
the intended recipient of this email, please notify the sender immediately and delete 
it without reading, copying, storing, forwarding or disclosing its contents to any 
other person
Thank you

Check us out at http://www.syntegra.com

********************************************************************

Reply via email to