473,796 Members | 2,573 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

error occured when i try to call server.createob ject 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_t est
4. Country_test

in my java code, icoMINDB_test extends icoCore_test,
icoSecureDB_tes t extends icoMINDB_test
and Country_test extends icoSecureDB_tes t

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_Initializ e()

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

'Load the main connection string.
Call loadMainConnStr ing
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_Accesso r As icoCORE_test
Private Sub Class_Initializ e()
'right now, the laodDefaults doesn't do anything
Call loadDefaults

End Sub

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

in icoSecureDB_tes t, i assigned a ptr to icoCore_test,
below is the code fragment from icoSecureDB_tes t
[vb]
Private icoMINDB_Access or As icoMINDB_test

Public Sub set_ICO_MINDB_P TR(ByVal accessor As
icoMINDB_test)
'initaite icoMINDB_Access or
Set icoMINDB_Access or = accessor
End Sub

[/vb]

in Country_test, i assigned a ptr to icoSecureDB_tes t,
below is the code fragment from Country_test
[vb]
Private Sub Class_Initializ e()

'set the table name, pKey value and connection type
SecureDB_Access or.getICOMINDBA ccessor.TableNa me
= "Countries"
SecureDB_Access or.getICOMINDBA ccessor.PKeyNam e
= "Country_Co de"
SecureDB_Access or.getICOMINDBA ccessor.ConnTyp e =
SecureDB_Access or.getICOMINDBA ccessor.TYPE_MA IN
'add more, if neccessary

End Sub
Public Sub set_ICO_SECURE_ PTR(ByVal accessor As
icoSecureDB_tes t)
Set SecureDB_Access or = 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.createOb ject("icoCore_t est")

'instantiate the icoMINDB_test object
dim objMINDB
set objMINDB = Server.createOb ject("icoMINDB_ test")

'set the ptr that linke objMINDB to its parent: icoCore
objMINDB.setICO _CORE_Ptr(objCo re)

'instantiate the icoSecureDB_tes t object
dim objsecureDB
set objsecureDB = Server.createOb ject("icoSecure DB_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.createOb ject("Country_t est")

'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.createOb ject("className ") a class's
sub Class_Initializ e() is called right? i am guessing is
it becuase in icoCore_test: in Class_Initializ e()
[vb]
Private Sub Class_Initializ e()

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

'Load the main connection string.
Call loadMainConnStr ing
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 2072
Wrong group... look into the VB6 group, this is .NET =)
"karen" <an*******@disc ussions.microso ft.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_t est
4. Country_test

in my java code, icoMINDB_test extends icoCore_test,
icoSecureDB_tes t extends icoMINDB_test
and Country_test extends icoSecureDB_tes t

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_Initializ e()

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

'Load the main connection string.
Call loadMainConnStr ing
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_Accesso r As icoCORE_test
Private Sub Class_Initializ e()
'right now, the laodDefaults doesn't do anything
Call loadDefaults

End Sub

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

in icoSecureDB_tes t, i assigned a ptr to icoCore_test,
below is the code fragment from icoSecureDB_tes t
[vb]
Private icoMINDB_Access or As icoMINDB_test

Public Sub set_ICO_MINDB_P TR(ByVal accessor As
icoMINDB_test)
'initaite icoMINDB_Access or
Set icoMINDB_Access or = accessor
End Sub

[/vb]

in Country_test, i assigned a ptr to icoSecureDB_tes t,
below is the code fragment from Country_test
[vb]
Private Sub Class_Initializ e()

'set the table name, pKey value and connection type
SecureDB_Access or.getICOMINDBA ccessor.TableNa me
= "Countries"
SecureDB_Access or.getICOMINDBA ccessor.PKeyNam e
= "Country_Co de"
SecureDB_Access or.getICOMINDBA ccessor.ConnTyp e =
SecureDB_Access or.getICOMINDBA ccessor.TYPE_MA IN
'add more, if neccessary

End Sub
Public Sub set_ICO_SECURE_ PTR(ByVal accessor As
icoSecureDB_tes t)
Set SecureDB_Access or = 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.createOb ject("icoCore_t est")

'instantiate the icoMINDB_test object
dim objMINDB
set objMINDB = Server.createOb ject("icoMINDB_ test")

'set the ptr that linke objMINDB to its parent: icoCore
objMINDB.setICO _CORE_Ptr(objCo re)

'instantiate the icoSecureDB_tes t object
dim objsecureDB
set objsecureDB = Server.createOb ject("icoSecure DB_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.createOb ject("Country_t est")

'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.createOb ject("className ") a class's
sub Class_Initializ e() is called right? i am guessing is
it becuase in icoCore_test: in Class_Initializ e()
[vb]
Private Sub Class_Initializ e()

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

'Load the main connection string.
Call loadMainConnStr ing
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.n et
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_Initializ e()
--
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_Initializ e()


Can you not use that in VB.net?

And this one in the text

Public Sub set_ICO_SECURE_ PTR(ByVal accessor As
icoSecureDB_tes t)

Is that typical VB6?

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

Private Sub Class_Initializ e()


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_Initializ e()


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

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

Similar topics

1
2118
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 understand that now and it seems to be fixed but the data I'm pulling from the HTML fields is not being appended correctly do my Access DB....The field in the DB now reads " ' ". I understand why it does that (my function) but what I need it to read is...
2
6317
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 I'm supposed to get meaning that my query seems to be working fine but instead of making its way to the INCLUDE file (bottom navigation bar) it displays the following error msg instead of the included nav bar... *** error '80020009' Exception...
1
1672
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 " A run time error has occured. Do you wish to debug? Line :0 , Object Expected". I just know that it is a Java Script error. Any suggestions on how to resolve this problem ? What could be the possible reasons for this error message?
2
1739
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 values from the service, however when I try to load the aspx page it falls over in a cruumbling heap! Could someone tell me what I am doing wrong as I know that I am close to getting this thing working. Thanks in advance for your answer
6
2095
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 (Google, MSN, etc) and in different newsgroups but we didn't find any solution. Some people had the same problem but they never got an answer. :-( This managed group is my last chance! We have a "legacy" ASP application that is showing a...
4
6722
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 DB Provider for SQL Server SQLState: 42000
4
11339
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. Thanks in advance.
1
3220
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 object with the line 'var oMyO = Server.CreateObject("Type.Class")'. I can successfuly call methods from that object (AKA a "ResetAll(DWORD ID)" by doing "oMyO.ResetAll = 1;"). But I can't seem to call a "Reset(DWORD x, DWORD y, DWORD ID)"...
1
2416
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. The code after returning from paypal is as follows. <!--#include file="../includes/connection1.asp"--> <!--#include file="Cart_Include.asp"--> <% ' read post from PayPal system and add 'cmd' str ="cmd=_notify-validate&"& Request.QueryString '...
0
9684
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9530
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10182
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9055
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5445
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5577
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.