I have been working on trying to populate my form/table. Not sure if you actually call it a form since it incoporates tables. I have the following code that displays the layout of the form. (This is only one row of the form there is much more to it.)
<html>
<head>
<title>Home Page</title>
</head>
<body>
<form method="POST">
<fieldset>
<br>
<table border=0 cellspacing=0 cellpadding=4 width=640>
<tr><p>
<td width="80" height="23"><font face="Times New Roman" size="3">
<strong>PROD NUM</strong>
</td>
<td height="23"><font face="Times New Roman" size="3" align="Left">
<input name="prodnum" type="TEXT" size="10" maxlength="8" text="2">
</td>
<td width="90" height="23"><font face="Times New Roman" size="3">
<strong>PROD TYPE</strong>
</td>
<td height="23"><font face="Times New Roman" size="3"
align="Left">
<input name="prodtype" type="TEXT" size="10"
maxlength="12">
</td>
<td width="85" height="23"><font face="Times New Roman"
size="3"><strong>PROD DATE</strong>
</td>
<td height="23"><font face="Times New Roman" size="3"
align="Left">
<input name="proddate" type="TEXT" size="10"
maxlength="12">
</td>
<td width="150" height="23"><font face="Times New
Roman" size="3"><strong>Prod Count</strong>
</td>
<td height="23"><font face="Times New Roman" size="3"
align="Left">
<input name="prodcount" type="TEXT" size="5"
maxlength="3">
</td>
</tr></p>
</table>
<p></p>
</fieldset>
</body>
</html>
So that code creates my lovely looking form. I just dont understand how to incorporate code that populates it with values from the database.
I have written the following for the Oracle 8.1.7 connection:
<%
'Varibles to establish Oracle Connection
Dim objConn
Dim strConnection
Dim RS
Set objConn = Server.CreateObject("ADODB.Connection"
strConnection="Provider=OraOLEDB.Oracle;Data Source=DVDB;User ID=sup_man;Password=kryptonite;"
objConn.Open strConnection
Set Rs = Server.CreateObject("ADODB.Recordset"
RS.Open "Select * from product where prod_num = '00000000'", objConn
do while not rs.EOF
Response.Write rs("prod_num" & "<br>"
Response.Write rs("prod_type" & "<br>"
Response.Write rs("prod_date" & "<br>"
Response.Write rs("prod_count" & "<br>"
rs.MoveNext ' Movenext
loop
'Deinitialize the Connection and Recordset
set Rs = nothing
set objconn = nothing
%>
Currently all this does is print out the prod_num to the screen. Like I said I am trying to move to the next level to populate each of the text boxes of the form that has already been established.
I really apreciate your help and apologize for any formatting problems when viewing this.
Thanks,
campbere
<html>
<head>
<title>Home Page</title>
</head>
<body>
<form method="POST">
<fieldset>
<br>
<table border=0 cellspacing=0 cellpadding=4 width=640>
<tr><p>
<td width="80" height="23"><font face="Times New Roman" size="3">
<strong>PROD NUM</strong>
</td>
<td height="23"><font face="Times New Roman" size="3" align="Left">
<input name="prodnum" type="TEXT" size="10" maxlength="8" text="2">
</td>
<td width="90" height="23"><font face="Times New Roman" size="3">
<strong>PROD TYPE</strong>
</td>
<td height="23"><font face="Times New Roman" size="3"
align="Left">
<input name="prodtype" type="TEXT" size="10"
maxlength="12">
</td>
<td width="85" height="23"><font face="Times New Roman"
size="3"><strong>PROD DATE</strong>
</td>
<td height="23"><font face="Times New Roman" size="3"
align="Left">
<input name="proddate" type="TEXT" size="10"
maxlength="12">
</td>
<td width="150" height="23"><font face="Times New
Roman" size="3"><strong>Prod Count</strong>
</td>
<td height="23"><font face="Times New Roman" size="3"
align="Left">
<input name="prodcount" type="TEXT" size="5"
maxlength="3">
</td>
</tr></p>
</table>
<p></p>
</fieldset>
</body>
</html>
So that code creates my lovely looking form. I just dont understand how to incorporate code that populates it with values from the database.
I have written the following for the Oracle 8.1.7 connection:
<%
'Varibles to establish Oracle Connection
Dim objConn
Dim strConnection
Dim RS
Set objConn = Server.CreateObject("ADODB.Connection"
strConnection="Provider=OraOLEDB.Oracle;Data Source=DVDB;User ID=sup_man;Password=kryptonite;"
objConn.Open strConnection
Set Rs = Server.CreateObject("ADODB.Recordset"
RS.Open "Select * from product where prod_num = '00000000'", objConn
do while not rs.EOF
Response.Write rs("prod_num" & "<br>"
Response.Write rs("prod_type" & "<br>"
Response.Write rs("prod_date" & "<br>"
Response.Write rs("prod_count" & "<br>"
rs.MoveNext ' Movenext
loop
'Deinitialize the Connection and Recordset
set Rs = nothing
set objconn = nothing
%>
Currently all this does is print out the prod_num to the screen. Like I said I am trying to move to the next level to populate each of the text boxes of the form that has already been established.
I really apreciate your help and apologize for any formatting problems when viewing this.
Thanks,
campbere