Here is another problem I am having.. I have 3 ASP pages..on the first page it is just a simple drop down box populated from a database.
<%
Do While NOT oRSa.EOF
Response.Write "<OPTION VALUE='" & oRSa("VendorId" & "'>"
Response.Write oRSa("VendorName" & "</OPTION>"
oRSa.MoveNext
Loop
oRSa.Close
Set oRSa=Nothing
%>
Then on my second page I am getting another variable from a drop down box populated from the database.
<%
Dim ItemVendor
parmvendor = Request.Form ("VendorChoice"
Dim oRSb
Set oRSb=Server.CreateObject("ADODB.Recordset"
sqltext= "SELECT Distinct ItemType FROM Items WHERE ItemVendor= " & parmvendor & ";"
oRSb.Open sqltext , "DSN=Clothier"
oRSb.MoveFirst
%>
Now I am having problems with the third page.
When I try to set the hidden variables I am getting "Object doesn't support this property or method: 'Form' " error.
I am trying to get the variable set in the second page with the following code..
parmVendor = Response.Form ("VendorName"
parmItem = Response.Form ("ItemChoice"
Can someone tell me what I am doing wrong here??
Thanks,
I am getting errors on this SQL text...
sqltext= "Select ItemName, ItemDepartment, ItemPriceBuy, ItemDateRelease FROM Items WHERE ((ItemType = ("& parmItem &") AND (ItemVendor = ('"& parmVendor & "'));"
It is giving me a syntax error on that code...
Syntax error (missing operator) in query expression '((Items.ItemType = ()) AND (Items.ItemVendor = ('2'));'.
Not sure what it means by missing operator?? mot98..
I am now getting an error saying :
Data type mismatch in criteria expression
I assume that means that it is trying to match it to something that is not defined?? But I can't figure out where.
I have defined my variables at the top reffering them back to the hidden fields..
parmVendor = Request.Querystring ("VendorName"
parmItem = Request.Querystring ("ItemChoice"
That error is a SQL error which means you're trying to use the wrong data type ie, text for an integer, or vice-versa.
You're probably getting this because parmitem is null. Try this:
If isnull(parmitem) AND Not isnull(parmvendor) then
sqltext= "Select Items.ItemName, Items.ItemDepartment, Items.ItemPriceBuy, Items.ItemDateRelease FROM Items WHERE ((Items.ItemVendor = ('"& parmVendor & "')));"
ElseIf isnull(parmvendor) AND Not isnull(parmitem) then
sqltext= "Select Items.ItemName, Items.ItemDepartment, Items.ItemPriceBuy, Items.ItemDateRelease FROM Items WHERE ((Items.ItemType = ("& parmItem &"));"
ElseIf isnul(parmvendor) AND isnull(parmitem) then
sqltext= "Select Items.ItemName, Items.ItemDepartment, Items.ItemPriceBuy, Items.ItemDateRelease FROM Items;"
Else
sqltext= "Select Items.ItemName, Items.ItemDepartment, Items.ItemPriceBuy, Items.ItemDateRelease FROM Items WHERE ((Items.ItemType = ("& parmItem &") AND (Items.ItemVendor = ('"& parmVendor & "')));"
End If
You can't pass a NULL value as a parameter, this should help you avoid that. Kyle
parmItem can't be Null...
On the previous page the code is like this..
<%
Do While NOT oRSb.EOF
Response.Write "<OPTION VALUE='" & oRSb("ItemType" & "'>"
Response.Write oRSb("ItemType" & "</OPTION>"
oRSb.MoveNext
Loop
oRSb.Close
Set oRSb=Nothing
%>
</Select> </P>
<Input Type=hidden Name=VendorName Value=<%=Request.Form("VendorChoice"%>>
<Input Type=hidden Name=ItemChoice Value=<%'"&ItemType&"'%>>
<P><Input Type="Submit"> </P>
So it gives both VendorName and ItemChoice a value..
Then on the last page it looks like this...
<%
Dim ItemVendor
parmVendor = Request.Querystring ("VendorName"
parmItem = Request.Querystring ("ItemChoice"
Dim oRSb
Set oRSb=Server.CreateObject("ADODB.Recordset"
sqltext= "Select ItemName, ItemDepartment, ItemPriceBuy, ItemDateRelease FROM Items WHERE (ItemType =('"& parmItem &"')) AND (ItemVendor =('"& parmVendor & "'));"
oRSb.Open sqltext , "DSN=Clothier"
'Response.Write sqltext
oRSb.MoveFirst
So I can't see why a Null would be effecting anything here.
Although on my first page I am not passing the value through hidden, I am just getting the value from the Response.Form method..Then I am trying to pass that value on again to the last page.. Maybe I should be using a hidden value on my first page as well??
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.