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

Busy SQL Connection Problem

Status
Not open for further replies.

MikeMV

MIS
May 15, 2006
131
US
Hello,

I am trying to update a field on a set of records on a SQL database using Visual FoxPro 9.0 code and a view, but I am getting a Connection xxxxx is busy error. I am wondering if something pops up at you that would create this error.

Thanks in advance for any help you can provide.

Mike.

* Program.: Discontinue.PRG
*
CLOSE ALL
CLEAR
SET DEFAULT TO C:\INVDISC
*
DELETE FILE C:\INVDISC\vinventory*.*
*
CREATE DATABASE vinventory
CREATE SQL VIEW vinventory;
REMOTE CONNECTION LocalSyspro;
AS select StockCode, Description, ProductClass FROM InvMaster WHERE (LEFT(StockCode,2) ='P2' OR LEFT(StockCode,2) ='P5' OR LEFT(StockCode,2) ='P6') AND ProductClass <> 'ZZZZ' ORDER BY StockCode
DBSETPROP ("vinventory", "View", "SendUpdates", .T.)
DBSETPROP("vinventory" , "VIEW","WhereType",3)
DBSETPROP("vinventory.ProductClass", "Field", "Updatable", .T.)
DBSETPROP("vinventory.ProductClass", "Field", "UpdateName", [InvMaster.ProductClass])
DBSETPROP("vinventory.ProductClass", "Field", "KeyField", .t.)
*
USE vinventory
*
REPLACE ALL StockCode WITH 'ZZZZ' FOR (LEFT(StockCode,2) ='P2' OR LEFT(StockCode,2) ='P5' OR LEFT(StockCode,2) ='P6' ) AND ProductClass <> 'ZZZZ'
*
IF NOT TABLEUPDATE(1, .t., [vinventory])
AERROR(laError)
MessageBox([Can not Update vinventory ]+laError[1,2])
EXIT
ENDIF
*
CLOSE DATABASES ALL
*
RETURN
*
* REVISION HISTORY
*
*
* EOF: Discontinue.PRG

 
Thanks a million Mike, that worked great.

That also clears up the same mistery I had with another piece of code. I ended up changing it to get around it, but now I know why the problem had come up.

Mike C.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top