p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_ecommerce thread: Beginning e-commerce: Chapter 5 (database problems)


Message #1 by "Trevor Lorimer" <d97ltg@c...> on Mon, 5 Mar 2001 14:07:36
Hello i'm a student, 

I have a problem where in chapter 5 page 133, 

i copied the code, however when i view the admin page to add a department 

the submitt button does not appear:



<!-- Button... -->

<tr><td colspan=2 align=center>

<br><input type=submitvalue="Add Department">

</td></tr>



If i move the code up the page the button appears, but doesnt work.



My other problem is on page 143 when i try to test the work, i already 

input values into the database but the names do not appear in the parent 

listbox.



I am using Windows 98 and PWS, is it a problem with SQL Server?



Any help would be very much appricated, thank you



Trevor
Message #2 by Ian Blackham <ianb@w...> on Mon, 5 Mar 2001 14:26:47 -0000
Hi,



If I remember correctly such problems are indicative of the RenderSelect

method not functioning correctly, so there is a problem with database access

somewhere along the line (maybe in some of the methods added on pages 138 -

140?).



As a first step I would suggest checking the set up of the Departments table

(cf. page 124) and column name headings etc. then looking carefully at the

VB code being added.



Ian B



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

From: Trevor Lorimer [mailto:d97ltg@c...]

Sent: Monday, March 05, 2001 2:08 PM

To: ASP ECommerce

Subject: [asp_ecommerce] Beginning e-commerce: Chapter 5 (database

problems)





Hello i'm a student, 

I have a problem where in chapter 5 page 133, 

i copied the code, however when i view the admin page to add a department 

the submitt button does not appear:



<!-- Button... -->

<tr><td colspan=2 align=center>

<br><input type=submitvalue="Add Department">

</td></tr>



If i move the code up the page the button appears, but doesnt work.



My other problem is on page 143 when i try to test the work, i already 

input values into the database but the names do not appear in the parent 

listbox.



I am using Windows 98 and PWS, is it a problem with SQL Server?



Any help would be very much appricated, thank you



Trevor

---

http://www.asptoday.com - the leading site for timely,

in-depth information for ASP developers everywhere.




Message #3 by williamshark@h... on Tue, 13 Mar 2001 05:01:22
Hello there,

I am sure I am no more knowledgweable than Ian (or even as learnt as him), 

but in this particular context, and having suffered like hell from this 

issue, I have a point to make.



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!





 









> Hello i'm a student, 

> I have a problem where in chapter 5 page 133, 

> i copied the code, however when i view the admin page to add a 

department 

> the submitt button does not appear:

> 

> <!-- Button... -->

> <tr><td colspan=2 align=center>

> <br><input type=submitvalue="Add Department">

> </td></tr>

> 

> If i move the code up the page the button appears, but doesnt work.

> 

> My other problem is on page 143 when i try to test the work, i already 

> input values into the database but the names do not appear in the parent 

> listbox.

> 

> I am using Windows 98 and PWS, is it a problem with SQL Server?

> 

> Any help would be very much appricated, thank you

> 


  Return to Index