Recordset problem: Why cannot open the table?

  • Thread starter Thread starter Min
  • Start date Start date
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
 
After changed the Size, there is no problem. But I am just wondering why the
query
"Select SizeID, Size, Width, Height from Size Order by SizeID"
runs fine ?
Min
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top