I am trying to learn Using ASP with MySQL. I can build a database, insert new data into it and get data from it. However I have not been able to figure out how to use the data I have retrieved.
What I want to do is to display the data retrieved in cells on a web page, when the user selects the record wanted display the selected record in a web page for viewing or modifying. The code for getting the selected data is:
x = request.querystring("LName"
If x = "" Then ' Get all records if blank
cmndString="select * from generic"
Else ' get only those records beginning with data entered
cmndString="select * from generic WHERE LName like '" & request.querystring("LName"
& "%" & "'"
END IF
Response.Write(cmndString)
set rs=cn.Execute(cmndString)
do until rs.eof
REM what I would like to do here is to pull up selected records and display certain data in cells
REM then allow the user to select the desired name and display all data for thst record
REM in a .htm form so the user could modify them if needed. How do I do this???
REM For Example, I can pull out the first name as shown here but I am lost as to what to do then.
FName = rs.fields("FName"
Response.Write("<TR>"
Response.Write("<TD>" & FName & "</TD></TR>"
Response.Write("<TR>"
Response.Write("<TD>" & rs.fields("FName"
& "</TD><TD>" & rs.fields("LName"
& "</TD><TD>" & rs.fields("Street1"
& "</TD><TD>" & rs.fields("Street2"
& "</TD><TD>" & rs.fields("City"
& "</TD><TD>" & rs.fields("State"
& "</TD><TD>" & rs.fields("Zip"
& "</TD><TD>" & rs.fields("HPhone"
& "</TD><TD>" & rs.fields("Fax"
& "</TD>"
Response.Write(FName & Street1)
rs.MoveNext
Response.Write("</TR>"
loop
%>
</BODY>
</HTML>
Thanks in advance
SmokeyJoe
What I want to do is to display the data retrieved in cells on a web page, when the user selects the record wanted display the selected record in a web page for viewing or modifying. The code for getting the selected data is:
x = request.querystring("LName"
If x = "" Then ' Get all records if blank
cmndString="select * from generic"
Else ' get only those records beginning with data entered
cmndString="select * from generic WHERE LName like '" & request.querystring("LName"
END IF
Response.Write(cmndString)
set rs=cn.Execute(cmndString)
do until rs.eof
REM what I would like to do here is to pull up selected records and display certain data in cells
REM then allow the user to select the desired name and display all data for thst record
REM in a .htm form so the user could modify them if needed. How do I do this???
REM For Example, I can pull out the first name as shown here but I am lost as to what to do then.
FName = rs.fields("FName"
Response.Write("<TR>"
Response.Write("<TD>" & FName & "</TD></TR>"
Response.Write("<TR>"
Response.Write("<TD>" & rs.fields("FName"
Response.Write(FName & Street1)
rs.MoveNext
Response.Write("</TR>"
loop
%>
</BODY>
</HTML>
Thanks in advance
SmokeyJoe