Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How To:Update a textbox with the current record of a database.

Status
Not open for further replies.

aviles22

Programmer
Jun 27, 2000
25
US
I have been trying to do this for quite some time. I am very stumped and anxious to learn the solution. I am using vb script with an access 2000 database. I know how to change the recordsets navigate through it and display the current record using response.write. But how can I assign a textbox to bind to my recordset or simply just use textbox1.text = recordset1.fields("fieldname1"). ANY INFO WOULD BE HIGHLY APPRECIATED! THANK YOU
 
<html>
<body>

<%
' Try this as an ASP page.
' Make your connection first to your database
Set Conn = &quot;Connection object here&quot;
Set rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)
strSQL = &quot;SELECT * FROM dbtable WHERE rec='rec_id'&quot;
rs.Open strSQL, Conn
Do While NOT rs.EOF
response.write &quot;<input type=text name=textbox1 value='&quot; & rs.field(&quot;field1&quot;).value & &quot;'>&quot;
response.write &quot;<input type=text name=textbox2 value='&quot; & rs.field(&quot;field2&quot;).value & &quot;'>&quot;
rs.movenext
Set rs = nothing
conn.close
Set conn = nothing

%>
</body>
</html>

------------
Fengshui1998 [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top