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: [EMAIL PROTECTED]
Debug: 0


HELP!
Tia,
Tab


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to