Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with ASP and Form in JavaScript 1

Status
Not open for further replies.

finnoscar

Technical User
Aug 17, 2002
55
0
0
GB
Could somebody help me sort this out. I need to add radio buttons to this script so that a user would have a choice of Small,medium or large and have the list of dogs meeting their choices returned as an ASP. I would be really grateful for as much help as possible

<%@ LANGUAGE = JavaScript%>
<HTML>
<BODY>
<TABLE BORDER=1>
<THEAD>
<TR>
<TH>Breed Name</TH>


<TH></TH>
</TR>
</THEAD>

<%
// Open connection to database, then populate a recordset with list of stock
var adoConnection = Server.CreateObject(&quot;ADODB.Connection&quot;);
var adoRecordSet;
var mySQL;
adoConnection.Open(&quot;DSN=DogDSN&quot;);
var mySQL = &quot;SELECT BreedName&quot; +
&quot; FROM Breeds&quot;;
adoRecordSet = adoConnection.Execute(mySQL);

// Loop through recordset and write Breed Names out to page
while ( adoRecordSet.Eof == false )
{
%>
<TR>
<TD><%=adoRecordSet(&quot;BreedName&quot;).Value%></TD>



</TR>
<%
adoRecordSet.MoveNext();
}

// Close Recordset and connections
// and release memory used by Recordset and Connection objects
adoRecordSet.Close();
adoRecordSet = null;
adoConnection.Close();
adoConnection = null;
%>
</TABLE>
</BODY>
</HTML>
 
Could you post the table definition? codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
You're not a complete programmer unless you know how to guess.
I hope I never consider myself an 'expert'.
<insert witticism here>
 
The table is as follows

Breeds
(BreedName, Size, Grooming, Exercise, SpaceReq, FeedingReq)

BreedName is a hyperlink and all the rest are text fields.
 
OK try commenting out the code lines building the SQL statement, one at a time

e.g. first line to comment out
mySQL += 'and FeedingReq=&quot;' +str_DogFeed +'&quot; ';
second line to comment out
mySQL += 'and SpaceReq=&quot;' +str_DogSpace +'&quot; ';
etc

try running the page again with the same inputs after commenting out each line. This should hopefully narrow down where the problem is. codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
You're not a complete programmer unless you know how to guess.
I hope I never consider myself an 'expert'.
<insert witticism here>
 
I tried doing this but I still get the same error message

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2.
/PickADog.asp, line 29

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top