Welcome to dbFreaks.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Compiler error: Invalid outside procedure

 
   Database Help (Home) -> Visual Basic RSS
Next:  ODBC Connection setup error  
Author Message
Utf-8BTGFycnkgQmly

External


Since: Jun 03, 2004
Posts: 1



(Msg. 1) Posted: Thu Jun 03, 2004 2:06 pm
Post subject: Compiler error: Invalid outside procedure
Archived from groups: microsoft>public>vb>database (more info?)

When I run the code below I get an error message of : "Compile error: invalid outside procedure"

Below I'm trying to open an Access 2003 database. Why do I get this error

Dim Cnxn As ADODB.Connection
strCnxn = "Provider=Microsoft.Jet.OLEDB.4.0" & ";Data Source=" & "C:\TravelandStop.mdb"
Cnxn.ConnectionString = strCnxn
Cnxn.Open

thanks

 >> Stay informed about: Compiler error: Invalid outside procedure 
Back to top
Login to vote
Al Reid1

External


Since: Sep 23, 2003
Posts: 163



(Msg. 2) Posted: Thu Jun 03, 2004 5:12 pm
Post subject: Re: Compiler error: Invalid outside procedure [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Is this code inside of a procedure (Function, Sub, Property, Event...). If not, that is why.

If it is inside of a procedure, post the code.

--
Al Reid

"It ain't what you don't know that gets you into trouble. It's what you know
for sure that just ain't so." --- Mark Twain

"Larry Bird" <anonymous RemoveThis @discussions.microsoft.com> wrote in message news:A2D6B9D4-4011-4576-83D7-AE1EC26631FC@microsoft.com...
 > When I run the code below I get an error message of : "Compile error: invalid outside procedure"
 >
 > Below I'm trying to open an Access 2003 database. Why do I get this error
 >
 > Dim Cnxn As ADODB.Connection
 > strCnxn = "Provider=Microsoft.Jet.OLEDB.4.0" & ";Data Source=" & "C:\TravelandStop.mdb"
 > Cnxn.ConnectionString = strCnxn
 > Cnxn.Open
 >
 > thanks
 >
 ><!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Compiler error: Invalid outside procedure 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Passing Var's to Procedure - what should I change in the procedure below that I can call it with more variables...(i,e) File2SqlBlob("c:\pic1.jpg","tablename","colname") I am having problem defining the variables within the procedure ..thank you for ...

data environment in data report- error?Why - I have a vb project and I have used data reports. The reports are working perfectly well here. But when I copy the whole folder to another machine, I cannot open the DataEnvironment and it shows error. Why?All the forms and reports can be opened in..

sql query returns in wrong format - Hi, Hope someone can help me with this. I have MS SQL 2000 database where i have Table "PriceList" and there a column "Pricemk" wich is data type "money". All data in this column is in form "10001,35". So why when...

arrays - is there a way to concatenate the contents of an array (looping through the array) and storing each item in a comma delimited string? Thanks!

DataReport PageBreak - Hi everyone, I would like to know how to force pagebreak in a datareport for example after 5 records printed. Thank you all
   Database Help (Home) -> Visual Basic All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]