K
Kosei B
Hi there,
If you have any idea why I get the below error message when I execute sql
using DAO?
The error message says: Error 3003 Could not start transaction/ Too many
transaction already nested.
I was testing some example codes that use transactions, but after getting
this error, I removed all the transactions and workspace, like ws.begintrans,
ws,committrans.
For my purpose, using transaction is not so crutial. I just need to append
and delete records as users change the selections on the list, and get record
set to show the current state of the table.
The codes I get this error for are:
Private Sub Form_Current()
dim rs as DAO.recordset
dim strSQL as string
Set rs = CurrentDb.OpenRecordset("Select [_camellia_id] From [Tea has
Camellia] Where [_tea_product_detail_id] = " & Me.txtTeaProductDetailID.Value)
End Sub
Private Sub lstCamelliaKind_AfterUpdate()
dim db as DAO.Database
dim strSQL as string
dim varItem as Variant
set db = DBEngine(0)(0)
strSQL = "Delete FROM [Tea has Camellia] Where [_tea_product_detail_id] = "
& Me.txtTeaProductDetailID.Value
With Me.lstCamelliaKind
For Each varItem In .ItemSelected
strSQL = "Insert INTO [Tea has Camellia] (_tea_product_detail_id,
_camellia_id) VALUE (" & me.txtTeaProductDetailID &" , " & .ItemData(varItem)
& ")"
Next varItem
End with
Thank you very much in advance,
Kosei
If you have any idea why I get the below error message when I execute sql
using DAO?
The error message says: Error 3003 Could not start transaction/ Too many
transaction already nested.
I was testing some example codes that use transactions, but after getting
this error, I removed all the transactions and workspace, like ws.begintrans,
ws,committrans.
For my purpose, using transaction is not so crutial. I just need to append
and delete records as users change the selections on the list, and get record
set to show the current state of the table.
The codes I get this error for are:
Private Sub Form_Current()
dim rs as DAO.recordset
dim strSQL as string
Set rs = CurrentDb.OpenRecordset("Select [_camellia_id] From [Tea has
Camellia] Where [_tea_product_detail_id] = " & Me.txtTeaProductDetailID.Value)
End Sub
Private Sub lstCamelliaKind_AfterUpdate()
dim db as DAO.Database
dim strSQL as string
dim varItem as Variant
set db = DBEngine(0)(0)
strSQL = "Delete FROM [Tea has Camellia] Where [_tea_product_detail_id] = "
& Me.txtTeaProductDetailID.Value
With Me.lstCamelliaKind
For Each varItem In .ItemSelected
strSQL = "Insert INTO [Tea has Camellia] (_tea_product_detail_id,
_camellia_id) VALUE (" & me.txtTeaProductDetailID &" , " & .ItemData(varItem)
& ")"
Next varItem
End with
Thank you very much in advance,
Kosei