slink9
asked on
Another ASP Question
VFP98, Win98 IE5.5
What could be wrong with this bit of code?
<%SQL = "SELECT Contest.ContestID,Contest. Title FROM Contest"
Set objConnection = Server.CreateObject("ADODB .Connectio n")
objConnection.Open "Sphinx"
Set objCommand = Server.CreateObject("ADODB .Command")
Set RS = Server.CreateObject("ADODB .Recordset ")
objCommand.CommandText = SQL
objCommand.CommandType = adCmdText
Set objCommand.ActiveConnectio n = objConnection
RS.Open objCommand,,adOpenForwardO nly,adLock ReadOnly%>
<h2>Select A Sphinx</h2>
<form method="POST" action="Sphinx2.asp">
<p><select name="Contest" size="1">
<% Do While Not RS.EOF %> <option value="<% = RS("ContestID") %>"><% = RS("Title") %></option>
<% RS.MoveNext
Loop
RS.Close
Set RS = Nothing %> </select><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset"
name="B2"></p>
The script to set up the SQL commands is straight from another page where it works. I have played around with it but keep getting an error with it. I believe the problem is in the Post method or below but I get an error in line 15.
What could be wrong with this bit of code?
<%SQL = "SELECT Contest.ContestID,Contest.
Set objConnection = Server.CreateObject("ADODB
objConnection.Open "Sphinx"
Set objCommand = Server.CreateObject("ADODB
Set RS = Server.CreateObject("ADODB
objCommand.CommandText = SQL
objCommand.CommandType = adCmdText
Set objCommand.ActiveConnectio
RS.Open objCommand,,adOpenForwardO
<h2>Select A Sphinx</h2>
<form method="POST" action="Sphinx2.asp">
<p><select name="Contest" size="1">
<% Do While Not RS.EOF %> <option value="<% = RS("ContestID") %>"><% = RS("Title") %></option>
<% RS.MoveNext
Loop
RS.Close
Set RS = Nothing %> </select><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset"
name="B2"></p>
The script to set up the SQL commands is straight from another page where it works. I have played around with it but keep getting an error with it. I believe the problem is in the Post method or below but I get an error in line 15.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Starting at the top (at 1) and counting the script as one line, number 15 would be
<% Do While Not RS.EOF %> <option value="<% = RS("ContestID") %>"><% = RS("Title") %></option>
<% Do While Not RS.EOF %> <option value="<% = RS("ContestID") %>"><% = RS("Title") %></option>
ASKER
Thanks. Problem found. It was a typo in the book. They had
<--Include xx-->
when it should have been
<--#Include xx-->
Stupid book!!
<--Include xx-->
when it should have been
<--#Include xx-->
Stupid book!!
You didn't need to award me the points....I didn't really help.
I will ask CS to return them to you.
I will ask CS to return them to you.
ASKER
You tried. Besides, I have 500 and only a couple of weeks to use them. No biggee.
slink9,
I have been asked by ClassyLinks to refund your points for this question. Looking at your profile I see you have been a member for a while. I will let you decide what action you would like to do with this question.
1) Keep it as it is
2) Reduce the points to 0 and keep it in the PAQ
3) Delete it after reducing the points to 0
BTW
I started programming on a TI994A with their version of basic and assembler, moved on to QuickBasic (not qbasic) with compiler and Rbase 5000. So we all did not start out in Qbasic LOL :)
kb
Community Support Moderator
Experts Exchange
I have been asked by ClassyLinks to refund your points for this question. Looking at your profile I see you have been a member for a while. I will let you decide what action you would like to do with this question.
1) Keep it as it is
2) Reduce the points to 0 and keep it in the PAQ
3) Delete it after reducing the points to 0
BTW
I started programming on a TI994A with their version of basic and assembler, moved on to QuickBasic (not qbasic) with compiler and Rbase 5000. So we all did not start out in Qbasic LOL :)
kb
Community Support Moderator
Experts Exchange
Up to you slink. I just don't want to appear points greedy...I've made my EE "quota" for the month and am always glad to help....no matter what the point level.
Cheers & Happy Coding!
Cheers & Happy Coding!
ASKER
It is fine to leave it as-is. I am sure I will have plenty more questions, especially after I finish the book and attempt to create something that is actually useful using ASP. Thanks for the help.
ASKER
objCommand.CommandType = adCmdText
2.Sphinx3
3.ADODB.Command error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/asp/Database/Sphinx3.asp,