# 请问错什么?

Posted by kkcheung on September 18, 1999 at 22:52:48:

selstr = "select * from sale_rec where sale_date like '" + Trim(T_FROM.Text) + "%'" 'T_FROM.Text 输入的日期

Set tempset = FMSDB.OpenRecordset(selstr, dbOpenSnapshot, dbSQLPassThrough)
Do While Not tempset.EOF
temp_inv = Trim(tempset.Fields!invo_code): temp_lot = Trim(tempset.Fields!stockno)

selstr2 = "select * from receive_rec where stock_no='" + temp_lot + "'"
Set tempset2 = FMSDB.OpenRecordset(selstr2, dbOpenSnapshot, dbSQLPassThrough)

temp_sendcode = Trim(tempset2.Fields!send_code)
sqlSTR = "UPDATE sale_rec SET send_code= '" + temp_sendcode + "' WHERE invo_code='" + temp_inv + "' and stockno='" + temp_lot + "'"
BeginTrans
FMSDB.Execute sqlSTR, dbSQLPassThrough

tempset.MoveNext <==第12次,便odbc call fialed-3146.
tempset2.Close
CommitTrans
Loop

我尝试了好几个日子运行,但tempset.MoveNext每到第12次,便odbc call fialed-3146.为什么呢?

Follow Ups: