Access 2007 - Error Message re: New ADODB.Recordset

sgtSortor

Registered User.
Local time
Today, 14:42
Joined
Mar 23, 2008
Messages
31
I've used this code in previous versions of access, but it gives me an error message in 2007.......

Code:
strSQL = "tblPanelSessions"[/SIZE][/FONT]
[SIZE=3][FONT=Calibri]    Set cnn = CurrentProject.Connection 'sets the connection to current database[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]    Set rst = New ADODB.Recordset 'sets the recordset to a new ADODB recordset[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]    rst.Open strSQL, cnn, adOpenStatic, adLockOptimistic, adCmdTable


The error message I'm getting is "Compile Error: User-defined type not defined"
HELP! :?:
:confused:
 
Access 2007 (without good cause IMHO) doesn't include the ADO reference by default (as the previous three versions did!)
Add such a reference and you'll be fine.
VBE > Tools > Reference
Microsoft ActiveX Data Objects (chances are anything from 2.1 - 2.8 would be fine. There's not a lot of reason not to choose 2.8 though really.)
 

Users who are viewing this thread

Back
Top Bottom