[thelist] MySQL/ASP - RecordSet Weirdness
Tab Alleman
talleman at RealMetros.com
Fri Mar 29 09:59:02 CST 2002
Does anyone know of any weird issues with getting the value of an
AutoIncrement Primary Index field into a recordset? I do a sql call
from an ASP page that loads the Index and one other field into a
recordset. The other field contains the expected data, but the Index
field in the recordset always contains Zero (0), and it shouldn't. When
I paste the sql into my front end GUI and run it, it shows the expected
results (not zero). Any clues?
Code (ASP/VBS) and Resulting output:
<%
Dim sql, rs, oConn, dbEmail, OutStr
sql = "SELECT ReservationIndex, ResEmail FROM Reservations WHERE
ResConSupplier='" & ResConSupp & "' ORDER BY BookDate"
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.open xHotelData
Set rs = oConn.Execute(sql)
Response.Write("<h3>Debug: " & sql & "</h3>")
IF rs.EOF Then
'hmm
OutStr = -1
ELSE
DO WHILE NOT rs.EOF
'go to the last one
dbEmail = rs.Fields("ResEmail").value
OutStr = rs.Fields("ReservationIndex").value
Response.Write("<h3>Debug: " &
rs.Fields("ResEmail").value & "</h3>")
Response.Write("<h3>Debug: " &
rs.Fields("ReservationIndex").value & "</h3>")
rs.MoveNext
LOOP
[...]
%>
Produces the following output:
Debug: SELECT ReservationIndex, ResEmail FROM Reservations WHERE
ResConSupplier='ZT9HSI' ORDER BY BookDate
Debug: tab.alleman at realmetros.com
Debug: 0
HELP!
Tia,
Tab
More information about the thelist
mailing list