p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_ecommerce thread: The ANSWER TO Page 143 Problems


Message #1 by williamshark@h... on Tue, 13 Mar 2001 05:04:15
Hello all,



I saw a request for help somewhere, and wrote the answer below, but after 

doing it I found that this cancerous problem has got to be made more 

public than in an answer and that it deserves to have its own thread.

So I re-wrote it here



It took me a week of trials and tribulations to come to this conclusion.



*The solution*



If you look at the code, you will find that the code draws the form in 

HTML/ASP then it calls out to the function Render_Select as Ian rightly 

suggests, but then the problem at Render_Select doesn't really end there, 

unfortunately, within Render_Select there are calls to VB functions that 

come from the Visit object and namely the "GetAllDepartments" method, and 

in this sub if you go there, you will find that this in turn calls for 

another function "QueryDepartments", and QueryDepartments in turn 

calls "RunQuery" which is in the Database.cls class, and ...



(Have you got time?) We're near the solution so don't despair yet o:)



RunQuery calls for the Execute method of the recordset of the DB 

connection returned from the object IUtility.



Now, to execute the SQL statement, if there is a type in your SQL 

structure then you will get the error on page 133, and just as well if 

there is any problem along the whole road I gave you above, you will get 

the same error of the button not showing.



I remember that one of the cancerous errors I had was that the "ViewName" 

in SQL did not actually return any records, and whatever you do along the 

way of HTML/ASP, nothing will make it work, and to get down to that error, 

I used the ASP Debugging method and when I realised where the problem was, 

I went to the SQL Query Analyzer and entered the SQL code as returned by 

my VB and when no records were selected, I checked the tables and it 

worked from there!

Message #2 by "Matt Riemann" <matt@a...> on Fri, 16 Mar 2001 17:38:00
> Hello all,

> 

> I saw a request for help somewhere, and wrote the answer below, but 

after 

> doing it I found that this cancerous problem has got to be made more 

> public than in an answer and that it deserves to have its own thread.

> So I re-wrote it here

> 

> It took me a week of trials and tribulations to come to this conclusion.

> 

> *The solution*

> 

> If you look at the code, you will find that the code draws the form in 

> HTML/ASP then it calls out to the function Render_Select as Ian rightly 

> suggests, but then the problem at Render_Select doesn't really end 

there, 

> unfortunately, within Render_Select there are calls to VB functions that 

> come from the Visit object and namely the "GetAllDepartments" method, 

and 

> in this sub if you go there, you will find that this in turn calls for 

> another function "QueryDepartments", and QueryDepartments in turn 

> calls "RunQuery" which is in the Database.cls class, and ...

> 

> (Have you got time?) We're near the solution so don't despair yet o:)

> 

> RunQuery calls for the Execute method of the recordset of the DB 

> connection returned from the object IUtility.

> 

> Now, to execute the SQL statement, if there is a type in your SQL 

> structure then you will get the error on page 133, and just as well if 

> there is any problem along the whole road I gave you above, you will get 

> the same error of the button not showing.

> 

> I remember that one of the cancerous errors I had was that 

the "ViewName" 

> in SQL did not actually return any records, and whatever you do along 

the 

> way of HTML/ASP, nothing will make it work, and to get down to that 

error, 

> I used the ASP Debugging method and when I realised where the problem 

was, 

> I went to the SQL Query Analyzer and entered the SQL code as returned by 

> my VB and when no records were selected, I checked the tables and it 

> worked from there!

I discovered the same things that you mentioned above, but I am still 

confused as to what I should do.  When I use the query analyzer it seems 

to work just fine.  Although when I test the error in VB and on the ASP 

page I get an error like "Object Variable or With block variable not set".



It appears to like the runquery isn't being created.



Please let me know if you have any suggestions.



thanks Matt
Message #3 by "Michael Clemmons" <michael@c...> on Fri, 16 Mar 2001 12:48:51 -0500
I have used this many times and have not had any problems.

Have you downloaded the sample code?



Mike Clemmons



-----Original Message-----

From: Matt Riemann [mailto:matt@a...]

Sent: Friday, March 16, 2001 5:38 PM

To: ASP ECommerce

Subject: [asp_ecommerce] Re: The ANSWER TO Page 143 Problems





> Hello all,

>

> I saw a request for help somewhere, and wrote the answer below, but

after

> doing it I found that this cancerous problem has got to be made more

> public than in an answer and that it deserves to have its own thread.

> So I re-wrote it here

>

> It took me a week of trials and tribulations to come to this conclusion.

>

> *The solution*

>

> If you look at the code, you will find that the code draws the form in

> HTML/ASP then it calls out to the function Render_Select as Ian rightly

> suggests, but then the problem at Render_Select doesn't really end

there,

> unfortunately, within Render_Select there are calls to VB functions that

> come from the Visit object and namely the "GetAllDepartments" method,

and

> in this sub if you go there, you will find that this in turn calls for

> another function "QueryDepartments", and QueryDepartments in turn

> calls "RunQuery" which is in the Database.cls class, and ...

>

> (Have you got time?) We're near the solution so don't despair yet o:)

>

> RunQuery calls for the Execute method of the recordset of the DB

> connection returned from the object IUtility.

>

> Now, to execute the SQL statement, if there is a type in your SQL

> structure then you will get the error on page 133, and just as well if

> there is any problem along the whole road I gave you above, you will get

> the same error of the button not showing.

>

> I remember that one of the cancerous errors I had was that

the "ViewName"

> in SQL did not actually return any records, and whatever you do along

the

> way of HTML/ASP, nothing will make it work, and to get down to that

error,

> I used the ASP Debugging method and when I realised where the problem

was,

> I went to the SQL Query Analyzer and entered the SQL code as returned by

> my VB and when no records were selected, I checked the tables and it

> worked from there!

I discovered the same things that you mentioned above, but I am still

confused as to what I should do.  When I use the query analyzer it seems

to work just fine.  Although when I test the error in VB and on the ASP

page I get an error like "Object Variable or With block variable not set".



It appears to like the runquery isn't being created.



Please let me know if you have any suggestions.



thanks Matt
Message #4 by "Matt Riemann" <matt@a...> on Fri, 16 Mar 2001 10:28:51 -0800
I discovered the error shortly after posting the message.  There was a

problem in the DB property Get.  It is working great now.



Thanks for getting back to me so quickly.



-----Original Message-----

From: Michael Clemmons [mailto:michael@c...]

Sent: Friday, March 16, 2001 9:49 AM

To: ASP ECommerce

Subject: [asp_ecommerce] Re: The ANSWER TO Page 143 Problems





I have used this many times and have not had any problems.

Have you downloaded the sample code?



Mike Clemmons



-----Original Message-----

From: Matt Riemann [mailto:matt@a...]

Sent: Friday, March 16, 2001 5:38 PM

To: ASP ECommerce

Subject: [asp_ecommerce] Re: The ANSWER TO Page 143 Problems





> Hello all,

>

> I saw a request for help somewhere, and wrote the answer below, but

after

> doing it I found that this cancerous problem has got to be made more

> public than in an answer and that it deserves to have its own thread.

> So I re-wrote it here

>

> It took me a week of trials and tribulations to come to this conclusion.

>

> *The solution*

>

> If you look at the code, you will find that the code draws the form in

> HTML/ASP then it calls out to the function Render_Select as Ian rightly

> suggests, but then the problem at Render_Select doesn't really end

there,

> unfortunately, within Render_Select there are calls to VB functions that

> come from the Visit object and namely the "GetAllDepartments" method,

and

> in this sub if you go there, you will find that this in turn calls for

> another function "QueryDepartments", and QueryDepartments in turn

> calls "RunQuery" which is in the Database.cls class, and ...

>

> (Have you got time?) We're near the solution so don't despair yet o:)

>

> RunQuery calls for the Execute method of the recordset of the DB

> connection returned from the object IUtility.

>

> Now, to execute the SQL statement, if there is a type in your SQL

> structure then you will get the error on page 133, and just as well if

> there is any problem along the whole road I gave you above, you will get

> the same error of the button not showing.

>

> I remember that one of the cancerous errors I had was that

the "ViewName"

> in SQL did not actually return any records, and whatever you do along

the

> way of HTML/ASP, nothing will make it work, and to get down to that

error,

> I used the ASP Debugging method and when I realised where the problem

was,

> I went to the SQL Query Analyzer and entered the SQL code as returned by

> my VB and when no records were selected, I checked the tables and it

> worked from there!

I discovered the same things that you mentioned above, but I am still

confused as to what I should do.  When I use the query analyzer it seems

to work just fine.  Although when I test the error in VB and on the ASP

page I get an error like "Object Variable or With block variable not set".



It appears to like the runquery isn't being created.



Please let me know if you have any suggestions.



thanks Matt




  Return to Index