Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21271

ADO Error - Method Open failed

$
0
0
Hello all,

I am writing an app in VB6 interacting with an Access 2000 database.

I am trying to use the following lines of code but get a "Method 'Open' failed" error.
the query works in Access - giving the results I want.

I have made a connection, CN (used in this same routine, and not closed) to get another recordset successfully, so I know it is working.

'MID' - is a string, 'CurrentYr' is an integer

Code:

   
    Set rs = New Recordset
    strQry = "SELECT MID, MAX(CurrentYr) as Current FROM tblMembership GROUP BY MID "
    rs.Open strQry, CN, adOpenStatic, adLockOptimistic, adCmdText

any thoughts would be much appreciated.

cheers
Phil

Viewing all articles
Browse latest Browse all 21271

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>