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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remote View Problem

Status
Not open for further replies.

DEDMOD

Programmer
Feb 1, 2001
721
US
I've got a Program I'm running 'lSchedule' with the following code:

Code:
OPEN DATA stables
USE mct IN 0
USE sched2 in 0
sele mct
vdate = mct.fdate
vname = mct.name1_ref
sele sched2
INSERT INTO Sched2(Schedule_ref, comp_ref, Scheddate, name1_ref, completed);
VALUES (SYS(2015), "FH", vdate, vname, .t.)
CLOSE TABLES
CLOSE DATA

Sched2 is a remote view I created using connection cDOL to a SQL Server 7 database 'DOL' on my computer. When I run the program I get an error with a message something like "connection cDOL is being used"

But when I run the exact same commands in the command window, I don't get an error and the new record is inserted ok. Can anyone tell me what I'm doing wrong?

Dave Dardinger

 
If you do not share the same connection between the views, make sure you are establishing a new connection to the server.

Maybe you'll consider to use SQLCONNECT() function before the INSERT.

Hope this helps. Grigore Dolghin
Class Software
Bucharest, Romania
 
The MCT is a local VFP table, not a view. So I don't think that's the problem. I may indeed look into SQLConnect(). Though I was under the impression that if you created a connection in your DB and used it in a view, FoxPro was supposed to take care of the connection problems. --Dave
 
Yes. FoxPro is supposed to take care the connection, if the "share connection" is checked. Please, verify this.

Thanks. Grigore Dolghin
Class Software
Bucharest, Romania
 
'Share Connection' came up here just a day or two ago and I did try clicking the box, but it made no difference. As I understand it, however, this is for use in multi-user situations and right now, I'm just prototyping on my home computer and not on a network.

BTW, to correct my original messge, the error message is 'cDOL is busy'.

Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top