Author | Topic: Odbcdbe | |
---|---|---|
Dariusz Bajszczak | Odbcdbe on Fri, 09 Apr 2010 16:33:37 +0200 Hi, I have problem with ODBCDBE and MsSql database. OS: Windows XP SP3 Database server: SQL Express 9.0.4035 ODBC Driver: SQL Native Client 2005.90.4035.0 or SQL Server 2000.85.1117.00 Alaska 1.90.331 Sample: SELECT * FROM table ORDER BY id FOR i=1 TO 10 SEEK myid[i] DO WHILE !EOF() .AND. id=myid[i] .. .. .. SKIP ENDDO NEXT First SKIP in this situation not working correctly. Before and after SKIP cursor stay on this same record (bur RECNO() are different). Next SKIP working correctly. This happing only after first SEEK (i=1), in next SEEK everything is ok. In sample code below, everything working correctly: SELECT * FROM table ORDER BY id FOR i=1 TO 10 GO TOP DO WHILE !EOF() IF id=myid[i] .. .. .. ENDIF SKIP ENDDO NEXT Best regards Dariusz Bajszczak | |
James Loughner | Re: Odbcdbe on Sat, 10 Apr 2010 10:41:44 -0400 The problem is that the concept of recno() does not exist in SQL so it is synthetic. Better to do something like this FOR i = 1 TO 10 SELECT * FROM table ORDER BY id FOR id = myid[i] DO WHILE !EOF() .... SKIP ENDDO NEXT I Jim On 04/09/2010 10:33 AM, Dariusz Bajszczak wrote: > Hi, > > I have problem with ODBCDBE and MsSql database. > OS: Windows XP SP3 > Database server: SQL Express 9.0.4035 > ODBC Driver: SQL Native Client 2005.90.4035.0 or SQL Server 2000.85.1117.00 > Alaska 1.90.331 > Sample: > > SELECT * FROM table ORDER BY id > > FOR i=1 TO 10 > SEEK myid[i] > DO WHILE !EOF() .AND. id=myid[i] > .. > .. > .. > SKIP > ENDDO > NEXT > > First SKIP in this situation not working correctly. Before and after SKIP > cursor stay on this same record (bur RECNO() are different). Next SKIP > working correctly. This happing only after first SEEK (i=1), in next SEEK > everything is ok. In sample code below, everything working correctly: > > SELECT * FROM table ORDER BY id > > FOR i=1 TO 10 > GO TOP > DO WHILE !EOF() > IF id=myid[i] > .. > .. > .. > ENDIF > SKIP > ENDDO > NEXT > > Best regards > Dariusz Bajszczak > > > > | |
James Loughner | Re: Odbcdbe on Sat, 10 Apr 2010 11:00:08 -0400 OOPS My SQL is rusty.... should be SELECT * FROM table ORDER BY id WHERE id = myid[i] Jim On 04/10/2010 10:41 AM, James Loughner wrote: > The problem is that the concept of recno() does not exist in SQL so it > is synthetic. > > Better to do something like this > > FOR i = 1 TO 10 > SELECT * FROM table ORDER BY id FOR id = myid[i] > DO WHILE !EOF() > .... > SKIP > ENDDO > NEXT I > > > Jim > > > On 04/09/2010 10:33 AM, Dariusz Bajszczak wrote: >> Hi, >> >> I have problem with ODBCDBE and MsSql database. >> OS: Windows XP SP3 >> Database server: SQL Express 9.0.4035 >> ODBC Driver: SQL Native Client 2005.90.4035.0 or SQL Server 2000.85.1117.00 >> Alaska 1.90.331 >> Sample: >> >> SELECT * FROM table ORDER BY id >> >> FOR i=1 TO 10 >> SEEK myid[i] >> DO WHILE !EOF() .AND. id=myid[i] >> .. >> .. >> .. >> SKIP >> ENDDO >> NEXT >> >> First SKIP in this situation not working correctly. Before and after SKIP >> cursor stay on this same record (bur RECNO() are different). Next SKIP >> working correctly. This happing only after first SEEK (i=1), in next SEEK >> everything is ok. In sample code below, everything working correctly: >> >> SELECT * FROM table ORDER BY id >> >> FOR i=1 TO 10 >> GO TOP >> DO WHILE !EOF() >> IF id=myid[i] >> .. >> .. >> .. >> ENDIF >> SKIP >> ENDDO >> NEXT >> >> Best regards >> Dariusz Bajszczak >> >> >> >> > | |
Adrian Wykrota | Re: Odbcdbe on Wed, 14 Apr 2010 15:43:48 +0200 I przy większej bazie danych seek na sql-lu to porażka - lepiej robić podzapytania dla każdego ID. Best regards Adrian Wykrota Użytkownik "Dariusz Bajszczak" <b_darek@poczta.onet.pl> napisał w wiadomości news:79190a65$66d053b2$2e0e2@news.alaska-software.com... > Hi, > > I have problem with ODBCDBE and MsSql database. > OS: Windows XP SP3 > Database server: SQL Express 9.0.4035 > ODBC Driver: SQL Native Client 2005.90.4035.0 or SQL Server > 2000.85.1117.00 > Alaska 1.90.331 > Sample: > > SELECT * FROM table ORDER BY id > > FOR i=1 TO 10 > SEEK myid[i] > DO WHILE !EOF() .AND. id=myid[i] > .. > .. > .. > SKIP > ENDDO > NEXT > > First SKIP in this situation not working correctly. Before and after SKIP > cursor stay on this same record (bur RECNO() are different). Next SKIP > working correctly. This happing only after first SEEK (i=1), in next SEEK > everything is ok. In sample code below, everything working correctly: > > SELECT * FROM table ORDER BY id > > FOR i=1 TO 10 > GO TOP > DO WHILE !EOF() > IF id=myid[i] > .. > .. > .. > ENDIF > SKIP > ENDDO > NEXT > > Best regards > Dariusz Bajszczak > > > > |