Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CursorAdapter en SEEK
Message
From
05/10/2005 10:24:53
 
 
To
05/10/2005 10:11:43
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01055601
Message ID:
01056268
Views:
16
Veronica,

>En primer lugar, gracias por las respuestas. En principio es una base Fox, pero la idea es poder utilizarla en un SQL Server haciendo pocos cambios. Lo que yo hago es un SEEK, pero que no solamente me busque en los datos traidos localmente sino en el servidor. Por ej si tengo 200 articulos, hago un SEEK y el articulo supongamos es el nro 10300 y este esta el servidor, lo que necesito es que lo localice rapidamente con este comando, sin hacer grandes cambios. El caso es tambien para un sistema de Gestion hecho en Fox 6 con tablas libres y queremos migrarlo a Fox 9 con la posibilidad de usar Motor SQL. Usamos el comando set beavior to para que se lea el codigo viejo, las tablas las abrimos con cursoradapter pero tambien tenemos el problemas del SEEK. Bueno le agradezco enormemente su atencion. Gracias

In CursorAdapter, you do NOT use SEEK if you want to find 1 record from the remote SQL database. Instead, you create a SQL Select statement with a WHERE clause to bring back just the record you want in the cursor. You can create your SELECT statement with a parameter, which will be evaluated when the command is sent to SQL Server:
oCA=CREATEOBJECT("CursorAdapter")
oCA.Alias = "test"
oCA.SelectCmd = "select * from customer where custid=?lcCustid"
* set the var to point to just the record you need
lcCustid = "123456"
oCA.CursorFill()
* browse the cursor with one record
browse
* get another record -- use CursorRefresh this time if you like
* For example, you might be bound to a grid and want to keep the same
* cursor instance. Of course, you can always use CursorFill(), but
* it destroys and rebuilds the cursor every time 
lcCustid = "234567"
oCA.CursorRefresh()
browse
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Previous
Reply
Map
View

Click here to load this message in the networking platform