If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > problem with populating list/menu box..

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-24-04, 21:38
lga860 lga860 is offline
Registered User
 
Join Date: Mar 2004
Posts: 1
problem with populating list/menu box..

Hi all,

Im fairly new to asp and vbscript respectively and this semester I have a database project to do that requires us to create a shopping cart or close to it. I created a page called game_catalog.asp and everytime I run it, it gives me an error:

Error Type:
Microsoft JET Database Engine (0x80040E10)
No value given for one or more required parameters.
/game_catalog.asp, line 30

Here is my code:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
'-----------------------------------------------------
'check session and validate user
'-----------------------------------------------------
response.expires = -1
dim custid, pass
custid = session("member_number")
pass = session("password")

dim soundstage, dbpath
dbpath = server.mappath("dbase/soundstage.mdb")
set soundstage = server.createobject("ADODB.Connection")
soundstage.open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & dbpath

dim findindb, selectfindindb
selectfindindb = "SELECT password from member_t WHERE member_number = """ & custid & """;"
set findindb = soundstage.execute(selectfindindb)
if findindb.eof then
response.redirect("login.htm")
end if
if findindb("password") <> pass then
response.redirect("login.htm")
end if
'------------------------------------------------------
'gamelist gathering
'------------------------------------------------------
dim game, qselectgame
qselectgame = "SELECT t_product_number as gnumber, title_of_work as title FROM title_t WHERE t_product_number IN (SELECT DISTINCT t_product_number FROM title_t WHERE EXISTS (SELECT * FROM product_t WHERE product_type <> game AND title_t.t_product_number = product_t.product_number));"
set game = soundstage.execute(qselectgame)

Line 30 is "set game = soundstage.execute(qselectgame)"

Here is the code for my form:

<form name="select-game" method="post" action="catalog_results.asp">
<table width="100" border="0">
<tr>
<td width="20" height="33"><div align="right">Choose Game:</div></td>
<td width="20"><select name="gid">
<%while not game.eof%>
<%response.write("<option value='" & game("gnumber") & "'>" & game("title")) & " </option>"%>
<%game.movenext
wend%>
</select></td>
<td width="60"><input type="submit" name="Submit" value="Submit"></td>
</tr>
</table>
</form>

Please help this poor newbie.... thanks......
Reply With Quote
  #2 (permalink)  
Old 03-24-04, 22:12
clinel clinel is offline
Registered User
 
Join Date: Oct 2002
Location: Western part of Georgia, USA
Posts: 123
not sure but try getting rid of the ; in your sql statement
Reply With Quote
  #3 (permalink)  
Old 03-25-04, 10:54
hausbro hausbro is offline
Registered User
 
Join Date: Mar 2004
Posts: 6
A good way to troubleshoot problems with your SQL statement is to display the statement after the page has compiled. You can do this by writing 'qselectgame' out to the page or storing it in a session variable. I usually store it in a session variable that way if the page errors you have still captured the statement. Then you need a 'displaysessions.asp' page (I can email you the code for this). If you fire up that page you'll be able to see all your session info. Then all you have to do is look at your SQL statement to make sure it's right. You could even copy and paste it into your db and test it out.

Let me know if you want the displaysession.asp code.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On