V
Vanessa
Here is my loop and it runs fine:
----------------------------------------------------
sSQL = "SELECT * FROM STORE_ITEMS"
Set DataRec = DB.execute(sSQL)
if not DataRec.EOF then
do while not DataRec.EOF
SKU = trim (DataRec("SKU"))
ITEM_ID = trim(DataRec("ITEM_ID"))
...
...
updateStock = "update STORE_ITEMS set STR_ITEMS=" &NumInStock& " where
ITEM_ID='" &ITEM_ID& "'"
DB.execute(updateStock)
DataRec.MoveNext
loop 'loop thru items
end if
----------------------------------------------------
But when I added "order by" clause to my query, and it gave me time out
error on this line:
[Microsoft][ODBC SQL Server Driver]Timeout expired
--> DB.execute(updateStock)
Here is the code that is not working:
----------------------------------------------------
sSQL = "SELECT * FROM STORE_ITEMS ORDER BY SKU"
Set DataRec = DB.execute(sSQL)
if not DataRec.EOF then
do while not DataRec.EOF
SKU = trim (DataRec("SKU"))
ITEM_ID = trim(DataRec("ITEM_ID"))
...
...
updateStock = "update STORE_ITEMS set STR_ITEMS=" &NumInStock& " where
ITEM_ID='" &ITEM_ID& "'"
DB.execute(updateStock)
DataRec.MoveNext
loop 'loop thru items
end if
----------------------------------------------------
sSQL = "SELECT * FROM STORE_ITEMS"
Set DataRec = DB.execute(sSQL)
if not DataRec.EOF then
do while not DataRec.EOF
SKU = trim (DataRec("SKU"))
ITEM_ID = trim(DataRec("ITEM_ID"))
...
...
updateStock = "update STORE_ITEMS set STR_ITEMS=" &NumInStock& " where
ITEM_ID='" &ITEM_ID& "'"
DB.execute(updateStock)
DataRec.MoveNext
loop 'loop thru items
end if
----------------------------------------------------
But when I added "order by" clause to my query, and it gave me time out
error on this line:
[Microsoft][ODBC SQL Server Driver]Timeout expired
--> DB.execute(updateStock)
Here is the code that is not working:
----------------------------------------------------
sSQL = "SELECT * FROM STORE_ITEMS ORDER BY SKU"
Set DataRec = DB.execute(sSQL)
if not DataRec.EOF then
do while not DataRec.EOF
SKU = trim (DataRec("SKU"))
ITEM_ID = trim(DataRec("ITEM_ID"))
...
...
updateStock = "update STORE_ITEMS set STR_ITEMS=" &NumInStock& " where
ITEM_ID='" &ITEM_ID& "'"
DB.execute(updateStock)
DataRec.MoveNext
loop 'loop thru items
end if