M
Min
Hi, The following two snippets are in the same subroutine. The first runs
fine, but the second one when runs to the * line got error:
1) Set rsType = New ADODB.Recordset
strSQL = "Select type from type order by Type"
rsType.ActiveConnection = cnn
rsType.Open strSQL, , adOpenDynamic, adLockOptimistic
2) Set rsSize = New ADODB.Recordset
strSQL = "Select SizeID, Size, Width, Height from Size Order by SizeID"
rsSize.ActiveConnection = cnn
* rsSize.Open strSQL, , adOpenDynamic, adLockOptimistic
a) If run in debug mode, got this error:
Automation error
b) If run in normal mode, got this error:
Failed when method 'Open' applied on object '_Recordset'
I've tested the query, it runs fine. I cannot understand why the error is
specific to the table Size.
Any help would be appreciated.
Min
fine, but the second one when runs to the * line got error:
1) Set rsType = New ADODB.Recordset
strSQL = "Select type from type order by Type"
rsType.ActiveConnection = cnn
rsType.Open strSQL, , adOpenDynamic, adLockOptimistic
2) Set rsSize = New ADODB.Recordset
strSQL = "Select SizeID, Size, Width, Height from Size Order by SizeID"
rsSize.ActiveConnection = cnn
* rsSize.Open strSQL, , adOpenDynamic, adLockOptimistic
a) If run in debug mode, got this error:
Automation error
b) If run in normal mode, got this error:
Failed when method 'Open' applied on object '_Recordset'
I've tested the query, it runs fine. I cannot understand why the error is
specific to the table Size.
Any help would be appreciated.
Min