|
-
Nov 28th, 2001, 10:18 AM
#1
Thread Starter
Member
business component
I keep getting this error when trying to run this script:
<%
Set objComponent = Server.CreateObject ("Test.Builder")
objComponent.ProcessQuery
%>
The error is:
"Object variable or With block variable not set"
I checked my code and it looks alright. Any suggestion on how to debug?
-
Nov 28th, 2001, 11:05 AM
#2
Code:
<% Dim MyDllRef, MyDllFunction
'create a reference to your actual dll
If not isobject(MyDllRef) then
set MyDllRef= server.CreateObject("MyProject.Myclass")
End if
'and again, using the SET keyword again,
'call your dll's sub or function :
Set MyDllFunction = MyDllRef.FunctionNo1_TheLarch
%>
Last edited by alex_read; Nov 28th, 2001 at 11:08 AM.
-
Nov 28th, 2001, 12:43 PM
#3
Thread Starter
Member
Damn, still get the same error. Do you think it is my code in the component or just they way I call the component.
-
Nov 29th, 2001, 03:13 AM
#4
It could be:
1) The naming of the dll (i.e. if you left it as project1, this causes an error when trying to reference it from a new vb project with the same name).
2) The dll is not registered on your pc properly - I'd check the regsvr program and add this to the components services mmc snap in if you use NT, 2000 or XP.
3) The instancing property of the class module you're calling is set wrong.
4) There's something wrong with your code.
You can check no4 by putting in a dummy function :
Code:
Public function TestIt() as Boolean
On error goto Jail
Dim i as integer
For i = 0 to 11
debug.print i
Next i
TestIt = True
Jail :
TestIt = false
End Function
That way, if you call this from the ASP page & get a value :
Code:
Set MyDllFunction = MyDllRef.FunctionNo1_TheLarch
response.write MyDllFunction
You'll know that the dll's up & running, & referenced okay, but there's something wrong in your other function.
Tell me - are you using Interdev to do your ASP pages ?
-
Nov 29th, 2001, 10:16 AM
#5
Thread Starter
Member
I tried the test function but still get the same error message.
I'm pretty sure it's not my code. I don't think my dll is not registered properly. Right now the the only copy of the dll is in the folder which I created the project.
I think this is how you register it:
regsvr32 test.dll
I ran this but got an error:
Load library("test.dll") failed
By the way I'm use FrontPage 2000, if it makes a difference.
-
Nov 29th, 2001, 10:24 AM
#6
2 options :
1) Start Menu > Run > Type in :
Regsvr32 "C:\Path\File.dll"
The path is important here 
2) Check this one out...
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
|