Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Server
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Miscellaneous
Thread ID:
00380000
Message ID:
00381888
Views:
18
A HA!... I see what is happening...

You have a remote view with zero parameters...

Then you issue a local select against the remote view...

What is happening is that the first time you issue the select, the remote view opens and pulls 100% of the records in PTMAST to the client... then it looks for the records you asked for.

You second select uses the same records that were already retrieved.

What you should do is use view parameters on your view... OR send the query to the back end directly, such as...

nConn = SQLConnect('yourDSNName')

nOK = SQLExec(nConn,[SELECT * FROM ptmast WHERE name LIKE 'S%'])

This will send the select to the backend and it will execute on the server and send the results.

Does this make sense to you? You can't use remote views that way. You are just causing VFP to load 100% of the table to the view the first time the view is opened. Then you are querying against the view which is now local data.

BOb


>Hi Bob,
>
>I will try to give you more information. I have a table on the server with about 50,000 records. In my local DBC, I have a remote view on the table (NOTE: I also have tried the following example using a connection and by going to the ODBC driver directly).
>
>The table name is ptmast. It has a field called name. When I fire up foxpro, open the dbc, and execute:
>
>SELECT * FROM ptmast WHERE name LIKE "S%" (or any character), the first time this is executed I get a wait window which says "Executing remote..." and at the bottom of the VFP window in the status bar I see a record counter which counts through ALL RECORDS (ALL 50,000). The next time I execute this query, EVEN IF I CHANGE THE WHERE CLAUSE, i.e.
>
>SELECT * FROM ptmast WHERE id = 1234234
>SELECT * FROM PTMAST WHERE dob = {10/15/2000}
>SELECT * FROM PTMAST WHERE name LIKE "C%"
>
>they all execute immediately (I do not see the "executing remote" nor to I see a counter in the status bar.
>
>The question is what in the hell is foxpro doing the first time I execute a query on the table?
>
>Also, I was incorrect in saying that it only did it once per foxpro session. If I close all tables and rexecute the query, the first time I query the table it counts. It is almost like it is building a local index or something along those lines.
>
>Thanks for the info
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform