Class not working

Memnoch1207
07-31-2002, 01:18 PM
here is the code on my asp page (this is just a test page to test the class I created)


<!--#include virtual="/core/classes/dbpaging.asp" -->
<!--#include virtual="/core/modules/common.asp" -->
<!--#include virtual="modules/asptemplate.asp"-->
<%
'create new aspTemplate object
set a = new aspTemplate
'create new dbpaging object
set t = new dbpaging
'pass table name to dbpaging set_table_name method
call t.set_table_name("catalogCategories")
'pass SQL string to dbpaging set_sqlString method
call t.set_sqlString("SELECT catId, des FROM catalogCategories ORDER BY des")
'pass records integer to be displayed per page
call t.set_recordsDisplayed(15)
'get total number of pages from dbpaging
numPages = t.calculate_totalPages()
'open global.asa specified connectionstring
db_open(application("connectionString"))
'set myD = dbpaging get_page funtion
set myD = t.get_page()

c = 1
'loop through the records adding 1 to the count;
'til EOF or count = recordsDisplayed integer
do until c = myD.Count
a.setVariable "FIELD1", myD(c)("catId")
a.setVariable "FIELD2", myD(c)("des")

c = c + 1
loop
'close the db connection
db_close

%>

<table width="50%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center">{{FIELD1}}</div></td>
<td><div align="center">{{FIELD2}}</div></td>
</tr>
</table>
<%response.Write("The SQL query is: " & sqlString)%>
<br>
<br>
<%response.Write("The table name is: " & tableName)%>
<br>
<br>
<%response.Write("The # of pages is: " & numPages)%>

the problem I am having is it is not getting the records from the database...How can I test to see if the info is being passed to the class??? I tried to do something like that above (with the last 3 response.write lines) Is there a way to see if the class is even getting the information??

Here (http://www.visualbasicforum.com/t33903.html) is a link to the class it calls.

Rezner
07-31-2002, 04:10 PM
This might be a good example for why you should test your code incrementally.

Memnoch1207
08-01-2002, 01:11 PM
lol:D this is...um...err...testing although not necessarily incrementally...I was just curious if there was a way to call the class and see if it was getting the information it was being passed?

Rezner
08-01-2002, 02:47 PM
Originally posted by Memnoch1207
lol:D this is...um...err...testing although not necessarily incrementally...I was just curious if there was a way to call the class and see if it was getting the information it was being passed? It's kinda hard to debug an ASP script. What I'd do if I were you is throw in unique response.write statements everywhere you think there might be a problem. If you do this, make sure you have the Buffer turned off.

Other than that, another option would be to comment everything in question out and then uncommenting things piece by piece, testing them as you go.

If I were you, I would do both of these things together.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum