Not sure whether this is a copy / paste error, but take a look at this:
sqlText="Select * FROM Student"
sqlText=sqlText & "WHERE ID="& UserID & ""
The SQL statement will end up like this:
Select * FROM StudentWHERE ID=12
There should be a space between the Student and WHERE clause.
Also, when you are querying for just one record (I assume the UserID is unique), there is no need for a loop:
If Not oRSmt.EOF Then
Response.Write(oRSmt("FirstName") & "<br>")
End If
This will write out just one record, because your WHERE clause will just return one record.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|