D
Dean J Garrett
We have an Access 2002 front-end with a SQL 2000 Server back-end. The code
below executes without an error, but nothing is updated in the table. Can
anyone tell why?
Thanks!
---------------------------------------------------
Public Const CONNECTSTRING = "Provider=sqloledb;User
ID=dodah; pwd=grump; Data Source=HOME\SQL; Initial
Catalog=TestFront"
consql.ConnectString = CONNECTSTRING
consql.open
Dim rsOrder As New ADODB.Recordset
cSQL = "SELECT top 1 * FROM tblOrderItems
ORDER BY TransactionID DESC"
rsOrder.CursorLocation = adUseClient
rsOrder.Open cSQL, consql, adOpenDynamic,
adLockOptimistic
rsOrder.AddNew
rsOrder!OrderType = cHeldOrderType
rsOrder!InventoryID = Me!txtInventoryId
rsOrder!CustomerId = rsSource!AccountId
rsOrder!QuantityOrdered =
rsSource!QuantityOrdered
rsOrder!QuantityShipped =
rsSource!QuantityOrdered
rsOrder!Status = "Invoiced"
rsOrder!statusdate = Date
rsOrder!EnterDate = Date
rsOrder!ReceiveDate = Date
nTransact = rsOrder!TransactionID
rsOrder.Update
rsOrder.Close
No error. But the table does not update.
below executes without an error, but nothing is updated in the table. Can
anyone tell why?
Thanks!
---------------------------------------------------
Public Const CONNECTSTRING = "Provider=sqloledb;User
ID=dodah; pwd=grump; Data Source=HOME\SQL; Initial
Catalog=TestFront"
consql.ConnectString = CONNECTSTRING
consql.open
Dim rsOrder As New ADODB.Recordset
cSQL = "SELECT top 1 * FROM tblOrderItems
ORDER BY TransactionID DESC"
rsOrder.CursorLocation = adUseClient
rsOrder.Open cSQL, consql, adOpenDynamic,
adLockOptimistic
rsOrder.AddNew
rsOrder!OrderType = cHeldOrderType
rsOrder!InventoryID = Me!txtInventoryId
rsOrder!CustomerId = rsSource!AccountId
rsOrder!QuantityOrdered =
rsSource!QuantityOrdered
rsOrder!QuantityShipped =
rsSource!QuantityOrdered
rsOrder!Status = "Invoiced"
rsOrder!statusdate = Date
rsOrder!EnterDate = Date
rsOrder!ReceiveDate = Date
nTransact = rsOrder!TransactionID
rsOrder.Update
rsOrder.Close
No error. But the table does not update.