PDA

View Full Version : sequel problem



gilgalbiblewhee
May 13th, 2006, 12:40 AM
I don't understand why title= 1 when the field title is a text?

Select title, chapter FROM scarletandthebeast WHERE title = 1

gilgalbiblewhee
May 13th, 2006, 04:54 AM
I don't even have 1 in the field. I don't know why it's reading 1.

Heres' what I have:

<td colspan="1" align="center">
<%
'This SQL statement creates a list of books
SQL1 = "Select title, chapter FROM scarletandthebeast WHERE title = '" & title & "'"
'& " ORDER BY Chapter ASC"

response.write sql1 & "</br>"
rs.Open sql1,conn, 1
%>
<select name="title" id="title" size="5" style="width:500;" onchange="go('refresh');" <%'onchange="go2();"%>>
<%
Do until RS.eof
%>
<option <%if title = rs("title") then response.write "selected" end if%> value="<%=RS("title")%>"><%=RS("title")%></option>

<%
rs.movenext
if rs.eof then
exit do
end if
Loop
%>
</select>
<%
rs.close

%>
</td>

And it's reading:

Select title, chapter FROM scarletandthebeast WHERE title = '1'

THis is what it should read instead of 1:


preface
"Scriptural Clues to the ""Mystery of Iniquity"""
Scripture, History and Conspiracy

Brandoe85
May 13th, 2006, 06:13 AM
Response.Write(title), what do you get?

gilgalbiblewhee
May 13th, 2006, 07:07 AM
Select title, chapter FROM scarletandthebeast WHERE chapter = ''


ADODB.Field error '80020009'

Either BOF or EOF is True, or the current record has been deleted; the operation requested by the application requires a current record.

?

I noticed,, since the code is recycled, that there were "int" and "Cint" wrapping the "request":

chapter = request("chapter")
title = request("title")
subtitle = request("subtitle")

I might as well send the code as attachment. I think it's a numerical problem which I can't figure: