Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remote View (Connection is Busy)

Status
Not open for further replies.

rlw1839

Programmer
Sep 10, 2002
18
US
I asked this question on 3/25/03 as 'PROBLEM UPDATING SQLSERVER VIA REMOTE VIEW/ODBC' and got no response.

I'd like to try again.

I have reviewed the discussion on lashwarj's question on 6/3/03. The sqlconnect/sqlmoreresults solution doesn't apply since I'm not using sqlexec to access the SQL SERVER table; I'm opening a remote view ('use gleads_vw').

I know what's happening; a connection is made with the sql server and a cursor is being generated;

THE PROBLEM: before all the records can be fetched my program has moved on and it is trying to update the remote table.

MY BANDAID has been to put a wait window before the first update and delay 5 seconds. This works most of the time unless the internet traffic is too slow or the table being fetched is to big. Then I get the "connection is busy" error; the connection is still being used to build the cursor.

WHEN USING A REMOTE VIEW IS THERE ANY WAY TO TEST WHETHER THE FETCHING IS COMPLETE; something like sqlmoreresults???
Is it necessary to scrap the remote view approach and use sqlexec instead? I'd rather not!





 
rlw1839,

You need to change the Fetchsize property of the view. You can do this either in the Advanced Options dialogue in the view designer (where it shows up as 'Records to fetch at a time'), or by programmatically setting the Fetchsize property.

You should set this either to a number that is larger than the number of records you expect to appear in the view, or to -1. Experiment with both options.

Mike


Mike Lewis
Edinburgh, Scotland
 
I sometimes do this to get around Connection Busy

USE LabelDataFile EXCLUSIVE && My View
LabelHand=CURSORGETPROP("ConnectHandle","LabelDataFile")
DO WHILE SQLGETPROP(LabelHand,"ConnectBusy")
=INKEY(5,"H")
enddo


note SQLGETPROP(LabelHand,"ConnectBusy") will return .t. if still busy and .f. when done pulling the data




Steve Bowman
steve.bowman@ultraex.com

 
The sequence that uses cursorgetprop and sqlgetprop works like a charm!! It captures the fact that the connection is still busy and keeps me from plowing right on with updates before the open process is completed. It's exactly what I've been looking for!!

Thanks..

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top