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
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