|
-
Jun 22nd, 2006, 08:07 AM
#1
Thread Starter
New Member
Run time error '91'
Hey there
I am currently experiencing a run time error with my project and seeking advise on what to do in this regard. The run time error is:
Run-time error "91"
object variable or With Block variable not set
If anyone can assist I would highly appreciate it. I am trying to run my application from a remote PC.
-
Jun 22nd, 2006, 08:11 AM
#2
PowerPoster
Re: Run time error '91'
Show us the code where it is happening. You are referencing an object that has not been set yet.
-
Jun 22nd, 2006, 08:15 AM
#3
Re: Run time error '91'
As posted show us the code.
Usually this error happens when you are trying to using an uninitialized object. Something like this
VB Code:
Dim accessCon As ADODB.COnnection
'this line will throw an error
AccessCon.ConnectionString = "......"
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Jun 22nd, 2006, 08:26 AM
#4
Thread Starter
New Member
Re: Run time error '91'
The thing is when I play the application where the development is being done the error does not show but when I make it to be an .exe and try to play it after downloading it, it gives me the error.
Remember I am trying to access it from remote/other workstations. Any ideas????? please..........
-
Jun 22nd, 2006, 08:32 AM
#5
Re: Run time error '91'
You must atleast have an Idea which function is throwing this error. Try to check what that function does and see if you can pinpoint the error.
The problem here is that we cannot help unless we see the code or exact description of the problem.
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Jun 22nd, 2006, 08:54 AM
#6
Lively Member
Re: Run time error '91'
You have to SET the object too.
Dim accessCon As ADODB.COnnection
SET accessCon = New ADODB.COnnection
or
Dim accessCon As New ADODB.COnnection <- not recommended because of memory leaking problems.
AccessCon.ConnectionString = "......"
Edited to correct a stupid quoting mistake...
Last edited by King_George; Jun 22nd, 2006 at 12:12 PM.
Energy can be neither created not destroyed. It can only be wasted.
Red Green
-
Jun 22nd, 2006, 09:04 AM
#7
Re: Run time error '91'
 Originally Posted by King_George
You have to SET the object too.
Dim accessCon As ADODB.COnnection
SET accessCon = New ADODB.COnnection
or
Dim accessCon As New ADODB.COnnection <- not recommended because of memory leaking problems.
AccessCon.ConnectionString = "......"
What was that for?
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Jun 22nd, 2006, 10:42 AM
#8
Re: Run time error '91'
Are you just copying the .exe file to the other computer, or are you copying the installation package and installing the whole application?
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
-
Jun 22nd, 2006, 12:11 PM
#9
Lively Member
Re: Run time error '91'
 Originally Posted by Shuja Ali
 What was that for?
OOPS... I'll edit that...sorry
Energy can be neither created not destroyed. It can only be wasted.
Red Green
-
Jun 22nd, 2006, 12:39 PM
#10
Re: Run time error '91'
 Originally Posted by King_George
You have to SET the object too.
Dim accessCon As ADODB.COnnection
SET accessCon = New ADODB.COnnection
or
Dim accessCon As New ADODB.COnnection <- not recommended because of memory leaking problems.
AccessCon.ConnectionString = "......"
Edited to correct a stupid quoting mistake...
King, actually I suspected the same.
But shouldn't it give error in IDE too
Pradeep
-
Jun 22nd, 2006, 12:53 PM
#11
Lively Member
Re: Run time error '91'
 Originally Posted by Pradeep1210
King, actually I suspected the same.
But shouldn't it give error in IDE too
Pradeep
Not always. You probably do not have Option Explicit turned on. As a note, ALWAYS have this at the top of each form module and you'll never get this type of error.
Remember the IDE is different that a runtime environment.
Energy can be neither created not destroyed. It can only be wasted.
Red Green
-
Jun 23rd, 2006, 12:51 AM
#12
Thread Starter
New Member
Re: Run time error '91'
To answer AL42, I am downloading the application from a server into another workstation that doesn't have VB6....
-
Jun 23rd, 2006, 01:05 AM
#13
Re: Run time error '91'
You still need to install the application for it to work correctly.
-
Jun 23rd, 2006, 11:03 AM
#14
Re: Run time error '91'
What randem said - you can't just copy files with a program written in VB.
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
-
Jun 29th, 2006, 12:42 AM
#15
Thread Starter
New Member
Re: Run time error '91'
I seem to have figured what the problem is, its the ADODC connection that I'm using cause with the ADODB connection method the application seems to work. Now my question is, is there a way of solving this or will I have to use the adodb connection outrite. If so can some one let me know of how I can connect a datagrid using the ADODB method.
Thanks in advance..............
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|