invalid outside procedure

S

SIN

Hi,
I am trying to run that procedure in vb and i get error:
"invalid outside procedure"

the code:
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset

Set cn = New ADODB.Connection <---- here

i add the references i:
microsoft activex data object 2.8 libary
microsoft activex data objects recordset 2.8 libray
microsoft access 11.0 object libary

thanks.
 
Top