N
nicver
I am fixing a client's Web site and for some reason an ASP class does
not want to use the variables it retrieves when it initialiases.
This is an excerpt of the class and it is enough to show what is not
working correctly:
------
Class clsAd
private pintMyData1
private pintMyData2
private pintMyData3
Private Sub class_Initialize()
(... creates some objects)
GetRequestData()
End Sub
Private Sub Class_Terminate()
(... kills some objects)
End Sub
Private Sub GetRequestData()
pintMyData1 = request("MyData1")
pintMyData2 = request("MyData2")
pintMyData3 = request("MyData3")
End Sub
Public Function AdList()
(retrieves a list from an SQL database use MyData1, etc...)
End Function
End Class
Dim AD
Set AD = new clsAd
------
First, MyPage.asp will include the class:
<!--#include virtual="/inc/clsAd.asp"-->
Then this code is supposed to retrieve a list of ads:
MyArray = AD.AdList()
The problem is that the variables are not retrieved properly and
therefore the list always includes the entire list (the Stored
Procedures functions this way).
If I insert "response.write pintMyData1" inside of the class, either
inside of GetRequestData() or of class_Initialize(), then the data will
show.
If I insert "response.write pintMyData1" inside of the parent
MyPage.asp, after the include, it does not show the data. If I insert
it inside of Public Function AdList(), it does not show either.
What is wrong in this code? I wonder if all the "private" should not be
switched to "public"? Or should I look into something else?
Thanks a lot in advance!
not want to use the variables it retrieves when it initialiases.
This is an excerpt of the class and it is enough to show what is not
working correctly:
------
Class clsAd
private pintMyData1
private pintMyData2
private pintMyData3
Private Sub class_Initialize()
(... creates some objects)
GetRequestData()
End Sub
Private Sub Class_Terminate()
(... kills some objects)
End Sub
Private Sub GetRequestData()
pintMyData1 = request("MyData1")
pintMyData2 = request("MyData2")
pintMyData3 = request("MyData3")
End Sub
Public Function AdList()
(retrieves a list from an SQL database use MyData1, etc...)
End Function
End Class
Dim AD
Set AD = new clsAd
------
First, MyPage.asp will include the class:
<!--#include virtual="/inc/clsAd.asp"-->
Then this code is supposed to retrieve a list of ads:
MyArray = AD.AdList()
The problem is that the variables are not retrieved properly and
therefore the list always includes the entire list (the Stored
Procedures functions this way).
If I insert "response.write pintMyData1" inside of the class, either
inside of GetRequestData() or of class_Initialize(), then the data will
show.
If I insert "response.write pintMyData1" inside of the parent
MyPage.asp, after the include, it does not show the data. If I insert
it inside of Public Function AdList(), it does not show either.
What is wrong in this code? I wonder if all the "private" should not be
switched to "public"? Or should I look into something else?
Thanks a lot in advance!