A
Ashish Kanoongo
Please review the code, andletmeknow whats wrong I am doing
*-----------------------------------------------------
Dim rsInvoiceRecord As New ADODB.Recordset
Dim oConn As New ADODB.Connection
Sql = "drop table tmpExcel"
If oConn.State = 1 Then oConn.Close
oConn.Open CurrentProject.Connection
oConn.Execute Sql
oConn.Close
*-------------------------------------------1st Error
The Database has been placed in a state by user 'Admin' on machine 'devp' that prevents it from being opened or locked
*------------------------------------------------ Once I skip/ignore this
Sql = "CREATE TABLE tmpExcel ([Account Name] text(30), [Invoice No] integer,[Billing Assets Quarter] currency default 0,[Advance Billing] currency default 0,[Capse Dist] currency default 0,"
For j = LBound(arrcode) To UBound(arrcode)
If arrcode(j) <> "" Then
Sql = Sql + arrcode(j) + " currency default 0, "
End If
Next
*-------------------------------------------2nd Error (Give me same error again)
The Database has been placed in a state by user 'Admin' on machine 'devp' that prevents it from being opened or locked
*------------------------------------------------
rsInvoiceRecord.ActiveConnection = CurrentProject.Connection
rsInvoiceRecord.CursorLocation = adUseClient
rsInvoiceRecord.Open "Select * from tmpExcel", , adOpenDynamic, adLockOptimistic
*-------------------------------------------3rdError (Give me same error again)
The Microsoft Jet database engine could not find the object.....
If here I stay 1-2 min in debug mode, then I run, it execute perfectly. It seems here it is looking for some delay. I also tried DoEvents, but not able to make it workable.
*------------------------------------------------
rsInvoiceRecord.AddNew
rsInvoiceRecord.Fields(0).Value = rsDetailInvoice.Fields(0).Value
..
..
..
rsInvoiceRecord.Update
rsInvoiceRecord.Close
*-----------------------------------------------------
I tried various option, please let me how do I handle this?
Ashish K
*-----------------------------------------------------
Dim rsInvoiceRecord As New ADODB.Recordset
Dim oConn As New ADODB.Connection
Sql = "drop table tmpExcel"
If oConn.State = 1 Then oConn.Close
oConn.Open CurrentProject.Connection
oConn.Execute Sql
oConn.Close
*-------------------------------------------1st Error
The Database has been placed in a state by user 'Admin' on machine 'devp' that prevents it from being opened or locked
*------------------------------------------------ Once I skip/ignore this
Sql = "CREATE TABLE tmpExcel ([Account Name] text(30), [Invoice No] integer,[Billing Assets Quarter] currency default 0,[Advance Billing] currency default 0,[Capse Dist] currency default 0,"
For j = LBound(arrcode) To UBound(arrcode)
If arrcode(j) <> "" Then
Sql = Sql + arrcode(j) + " currency default 0, "
End If
Next
*-------------------------------------------2nd Error (Give me same error again)
The Database has been placed in a state by user 'Admin' on machine 'devp' that prevents it from being opened or locked
*------------------------------------------------
rsInvoiceRecord.ActiveConnection = CurrentProject.Connection
rsInvoiceRecord.CursorLocation = adUseClient
rsInvoiceRecord.Open "Select * from tmpExcel", , adOpenDynamic, adLockOptimistic
*-------------------------------------------3rdError (Give me same error again)
The Microsoft Jet database engine could not find the object.....
If here I stay 1-2 min in debug mode, then I run, it execute perfectly. It seems here it is looking for some delay. I also tried DoEvents, but not able to make it workable.
*------------------------------------------------
rsInvoiceRecord.AddNew
rsInvoiceRecord.Fields(0).Value = rsDetailInvoice.Fields(0).Value
..
..
..
rsInvoiceRecord.Update
rsInvoiceRecord.Close
*-----------------------------------------------------
I tried various option, please let me how do I handle this?
Ashish K