473,402 Members | 2,064 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

error occured when i try to call server.createobject in ASP

Hi all :
this is going to be a long post. So i apologize in
advance :)
i am converting a java program in VB right now. I am a
java programmer by trade. so i am no expert in this
department.
I have written the following three class:

1.icoCORE_test
2.icoMINDB_test
3.icoSecureDB_test
4. Country_test

in my java code, icoMINDB_test extends icoCore_test,
icoSecureDB_test extends icoMINDB_test
and Country_test extends icoSecureDB_test

but I am aware the fact that VB doesn't support
inheritance so what i did is,
this is the top most class icoCore_test
[vb]
Private Sub Class_Initialize()

'Attempt to load built-in ASP objects.
Call loadASPObjects

'Load the main connection string.
Call loadMainConnString
end sub

[/vb]
in icoMINDB_test, i assigned a ptr to icoCore_test, below
is the code fragment from icoMINDB_test
[vb]
Option Explicit

'an object reference to icoMINDB's parent class -icoCORE
Private icoCORE_Accessor As icoCORE_test
Private Sub Class_Initialize()
'right now, the laodDefaults doesn't do anything
Call loadDefaults

End Sub

Public Sub setICO_CORE_Ptr(ByVal accessor As icoCORE_test)
'initialize icoCORE_Accessor
Set icoCORE_Accessor = accessor
End Sub
[/vb]

in icoSecureDB_test, i assigned a ptr to icoCore_test,
below is the code fragment from icoSecureDB_test
[vb]
Private icoMINDB_Accessor As icoMINDB_test

Public Sub set_ICO_MINDB_PTR(ByVal accessor As
icoMINDB_test)
'initaite icoMINDB_Accessor
Set icoMINDB_Accessor = accessor
End Sub

[/vb]

in Country_test, i assigned a ptr to icoSecureDB_test,
below is the code fragment from Country_test
[vb]
Private Sub Class_Initialize()

'set the table name, pKey value and connection type
SecureDB_Accessor.getICOMINDBAccessor.TableName
= "Countries"
SecureDB_Accessor.getICOMINDBAccessor.PKeyName
= "Country_Code"
SecureDB_Accessor.getICOMINDBAccessor.ConnType =
SecureDB_Accessor.getICOMINDBAccessor.TYPE_MAIN
'add more, if neccessary

End Sub
Public Sub set_ICO_SECURE_PTR(ByVal accessor As
icoSecureDB_test)
Set SecureDB_Accessor = accessor

End Sub
[/vb]

what happen is i did the following in my ASP code
[vb]
'instantiate the icoCore_test object
dim objCore
set objCore = Server.createObject("icoCore_test")

'instantiate the icoMINDB_test object
dim objMINDB
set objMINDB = Server.createObject("icoMINDB_test")

'set the ptr that linke objMINDB to its parent: icoCore
objMINDB.setICO_CORE_Ptr(objCore)

'instantiate the icoSecureDB_test object
dim objsecureDB
set objsecureDB = Server.createObject("icoSecureDB_test")

'set the ptr that linke objsecureDB to its parent:
icoMINDB
objsecureDB.set_ICO_MINDB_PTR(objMINDB)

'instantiate the country_test object
dim objCountry
set objCountry = Server.createObject("Country_test")

'set the ptr that linke objsecureDB to its parent:
icoSecureDB
objCountry.set_ICO_SECURE_PTR(objsecureDB)

[/vb]

when i try to run this asp page, i got the following
error:
"object variable or with block not set"

but strangely enough, if i just instantiate: icoCore
object, the top most class in the hierachy, it is fine.
and i could even test out some of the functionality.
so I am just really puzzled as to where the problem is.
there really is no way to debug this because this is a
problem with the most basic error like setting an object.
my question is why am i getting this strange error msg.
and why it worked for the top most class but not its
descedant classes...
when you call server.createObject("className") a class's
sub Class_Initialize() is called right? i am guessing is
it becuase in icoCore_test: in Class_Initialize()
[vb]
Private Sub Class_Initialize()

'Attempt to load built-in ASP objects.
Call loadASPObjects

'Load the main connection string.
Call loadMainConnString
end sub
[/vb]
laodASPObjects() are called, but some of the asp settings
are not provided in the global.asa file?? so i am getting
this "object variable or with block not set" ???
i'd really appreciate it if someone can offer me some
help on this

Many thanks
Nov 20 '05 #1
12 2033
Wrong group... look into the VB6 group, this is .NET =)
"karen" <an*******@discussions.microsoft.com> wrote in message
news:01****************************@phx.gbl...
Hi all :
this is going to be a long post. So i apologize in
advance :)
i am converting a java program in VB right now. I am a
java programmer by trade. so i am no expert in this
department.
I have written the following three class:

1.icoCORE_test
2.icoMINDB_test
3.icoSecureDB_test
4. Country_test

in my java code, icoMINDB_test extends icoCore_test,
icoSecureDB_test extends icoMINDB_test
and Country_test extends icoSecureDB_test

but I am aware the fact that VB doesn't support
inheritance so what i did is,
this is the top most class icoCore_test
[vb]
Private Sub Class_Initialize()

'Attempt to load built-in ASP objects.
Call loadASPObjects

'Load the main connection string.
Call loadMainConnString
end sub

[/vb]
in icoMINDB_test, i assigned a ptr to icoCore_test, below
is the code fragment from icoMINDB_test
[vb]
Option Explicit

'an object reference to icoMINDB's parent class -icoCORE
Private icoCORE_Accessor As icoCORE_test
Private Sub Class_Initialize()
'right now, the laodDefaults doesn't do anything
Call loadDefaults

End Sub

Public Sub setICO_CORE_Ptr(ByVal accessor As icoCORE_test)
'initialize icoCORE_Accessor
Set icoCORE_Accessor = accessor
End Sub
[/vb]

in icoSecureDB_test, i assigned a ptr to icoCore_test,
below is the code fragment from icoSecureDB_test
[vb]
Private icoMINDB_Accessor As icoMINDB_test

Public Sub set_ICO_MINDB_PTR(ByVal accessor As
icoMINDB_test)
'initaite icoMINDB_Accessor
Set icoMINDB_Accessor = accessor
End Sub

[/vb]

in Country_test, i assigned a ptr to icoSecureDB_test,
below is the code fragment from Country_test
[vb]
Private Sub Class_Initialize()

'set the table name, pKey value and connection type
SecureDB_Accessor.getICOMINDBAccessor.TableName
= "Countries"
SecureDB_Accessor.getICOMINDBAccessor.PKeyName
= "Country_Code"
SecureDB_Accessor.getICOMINDBAccessor.ConnType =
SecureDB_Accessor.getICOMINDBAccessor.TYPE_MAIN
'add more, if neccessary

End Sub
Public Sub set_ICO_SECURE_PTR(ByVal accessor As
icoSecureDB_test)
Set SecureDB_Accessor = accessor

End Sub
[/vb]

what happen is i did the following in my ASP code
[vb]
'instantiate the icoCore_test object
dim objCore
set objCore = Server.createObject("icoCore_test")

'instantiate the icoMINDB_test object
dim objMINDB
set objMINDB = Server.createObject("icoMINDB_test")

'set the ptr that linke objMINDB to its parent: icoCore
objMINDB.setICO_CORE_Ptr(objCore)

'instantiate the icoSecureDB_test object
dim objsecureDB
set objsecureDB = Server.createObject("icoSecureDB_test")

'set the ptr that linke objsecureDB to its parent:
icoMINDB
objsecureDB.set_ICO_MINDB_PTR(objMINDB)

'instantiate the country_test object
dim objCountry
set objCountry = Server.createObject("Country_test")

'set the ptr that linke objsecureDB to its parent:
icoSecureDB
objCountry.set_ICO_SECURE_PTR(objsecureDB)

[/vb]

when i try to run this asp page, i got the following
error:
"object variable or with block not set"

but strangely enough, if i just instantiate: icoCore
object, the top most class in the hierachy, it is fine.
and i could even test out some of the functionality.
so I am just really puzzled as to where the problem is.
there really is no way to debug this because this is a
problem with the most basic error like setting an object.
my question is why am i getting this strange error msg.
and why it worked for the top most class but not its
descedant classes...
when you call server.createObject("className") a class's
sub Class_Initialize() is called right? i am guessing is
it becuase in icoCore_test: in Class_Initialize()
[vb]
Private Sub Class_Initialize()

'Attempt to load built-in ASP objects.
Call loadASPObjects

'Load the main connection string.
Call loadMainConnString
end sub
[/vb]
laodASPObjects() are called, but some of the asp settings
are not provided in the global.asa file?? so i am getting
this "object variable or with block not set" ???
i'd really appreciate it if someone can offer me some
help on this

Many thanks

Nov 20 '05 #2
Cor
HI CJ,

Why you think this is VB6?

I think this is vb.net maybe used withouth Visual.studio.net
Cor

Wrong group... look into the VB6 group, this is .NET =)


Nov 20 '05 #3
Cor
Hi karen,

It is a long post and therefore not easy to answer I take some words from it
and try to tell you something first.

In VB.net are used windowforms, webforms and stand alone aspx.pages.

Sometimes confusing is that you can use it with just in time compiling and
with dll's made by vb.net for that (which are by the way again compiled by
the framework because it is intermidiate language).

Maybe it is wise to tell us how you are using it, than we get some more
understanding from the problem.
but I am aware the fact that VB doesn't support
inheritance so what i did is,


But this thing I did find primaly a important part of your message. This
newsgroup is full of inheritance and it is a major part of all coding in
VB.net, all classes inherite all the time from a higher class.

I hope this helps something

Cor

Nov 20 '05 #4
"Cor" <no*@non.com> schrieb

Why you think this is VB6?

Private Sub Class_Initialize()
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #5
Cor
Hi Armin,

Private Sub Class_Initialize()


Can you not use that in VB.net?

And this one in the text

Public Sub set_ICO_SECURE_PTR(ByVal accessor As
icoSecureDB_test)

Is that typical VB6?

Cor
Nov 20 '05 #6
"Cor" <no*@non.com> schrieb
Hi Armin,

Private Sub Class_Initialize()


Can you not use that in VB.net?


Is it used more often in VB.NET or in VB6? I think the answer is VB6 in
99.9%
--
Armin

Nov 20 '05 #7
Cor
Hi Armin,

Private Sub Class_Initialize()


Can you not use that in VB.net?


Is it used more often in VB.NET or in VB6? I think the answer is VB6 in
99.9%


Is this to give me a lesson about quoting, you know this is not true what
you are writting now I think.

:-))

Cor
Nov 20 '05 #8
sorry:
i think i have confused everyone..yeah.this is done in
VB6, not VB.net....
but if you could lend me some insights in this problem.
i'd truly appreciate it.

thanks,,

karen
Nov 20 '05 #9
Cor
Hi Karen,

I am happy you wrote this, I lost this one :-(

But still :-))

Cor
i think i have confused everyone..yeah.this is done in
VB6, not VB.net....
but if you could lend me some insights in this problem.
i'd truly appreciate it.

Nov 20 '05 #10
Cor
Hi Karen,

To give something as a real answer.

If you are using VB6 for this, you would using probably a IIS project with
the webclass.

That had a lot of bugs and Microsoft did stopped it very quick.

When you want to reach the goals that was intended to get by that go fast to
VB.net.

I am in doubt, because your code does not look like classic asp vbs.

Just a thought and still a little bit curious.

Cor
Nov 20 '05 #11
On Sat, 6 Dec 2003 05:59:07 -0800, "karen"
<an*******@discussions.microsoft.com> wrote:
sorry:
i think i have confused everyone..yeah.this is done in
VB6, not VB.net....
but if you could lend me some insights in this problem.
i'd truly appreciate it.


You would probably get more help in
microsoft.public.vb.general.discussion or one of the ASP-specific
groups. A lot of us haven't touched ASP classic in years.

--Jekke
==
To e-mail me, deobfuscate jekkeATinsidejokeDOTtv.
Nov 20 '05 #12
"Cor" <no*@non.com> schrieb
Hi Armin,
>
> Private Sub Class_Initialize()
>

Can you not use that in VB.net?


Is it used more often in VB.NET or in VB6? I think the answer is
VB6 in 99.9%


Is this to give me a lesson about quoting, you know this is not true
what you are writting now I think.

:-))


??
I really think that 99.9% of VB.NET apps don't use a "sub
Class_Initialize" - or didn't I get the point?
--
Armin

Nov 20 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: dmiller23462 | last post by:
Hey guys.... I put an error-handling in my page and have it posted at the complete end of the code, see below(when people were putting in 's I was getting the delimiter errors). Great, I...
2
by: dmiller23462 | last post by:
Hey guys, I'm back again....I've got the results displaying that I wanted but instead of having a "next" or "previous" link displayed I am getting the error msg below (I actually get the data that...
1
by: questionr | last post by:
There is a spell checker function which is written in VB Script. The function works well when tested seperately. But when the function is called from Java Script, the function shows an Error saying...
2
by: sean | last post by:
Hi there, I am trying to call a C# web service from an aspx page, I have the asmx file, a user control file ascx and the aspx file. I have verified that the web service is returning correct...
6
by: Raul Rodriguez | last post by:
I posted this question already but nobody could answer me. Please forgive for doing it again, but it's very important for my company. We have been searching for this error with different engines...
4
by: Jack | last post by:
Hi, I am trying to run an example code from a book. However I am getting the following error message: Number: -2147217900 Description: Syntax error or access violation Source: Microsoft OLE...
4
by: Abdhul Saleem | last post by:
Hi, I am recieving error ActiveX component can't create object in the following line in the asp page. set ExcelApp = CreateObject("Excel.Application") Previously this code was working fine....
1
by: NvrBst | last post by:
I'm having a problem with a "Member not found. (Exception from HRESULT: 0x80020003 DISP_E_MEMBERNOTFOUND))" error. The origional ASP is JScript, and the ASP.NET is JScript.NET. I'm creating an...
1
by: MehtabKhan | last post by:
Any one who tell me what’s wrong with this code. When I pass values to pay pal by using www.sandbox.paypal.com/cgi-bin/webscr all the code are working well. The orders are generating accurately....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.