invalid outside procedure

  • Follow


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.


0
Reply Utf 7/24/2007 8:34:00 PM

The question would be, where do you have this code? *invalid outside
procedure* would seem to indicate you don't have it inside of a Sub or a
Function, which, as the messae says, can't be done!


SIN wrote:
>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.

-- 
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access/200707/1

0
Reply missinglinq 7/24/2007 8:49:52 PM

1 Replies
1583 Views

(page loaded in 0.096 seconds)


Reply: