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 Syntegra Innovation Place Delta Bank Road Newcastle NE11 9DJ Tel 0191 461 4522 Fax 0191 460 1987 -----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 ********************************************************************
