M
mike
I have a form that I can edit the text from an access database if the
field is a text box but if it's a textarea it just appears blank.
Here's my code on my edit page:
<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsHome 'Holds the recordset for the record to be updated
Dim strSQL 'Holds the SQL query for the database
Dim lngRecordNo 'Holds the record number to be updated
'Read in the record number to be updated
lngRecordNo = CLng(Request.QueryString("ID"))
'Create an ADO connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less
connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("homep.mdb")
'Set an active connection to the Connection object using DSN
connection
'adoCon.Open "DSN=guestbook"
'Create an ADO recordset object
Set rsHome = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an SQL statement to query the
database
strSQL = "SELECT homepc.* FROM homepc WHERE home_ID=" & lngRecordNo
'Open the recordset with the SQL query
rsHome.Open strSQL, adoCon
%>
<html>
<head>
<title></title>
</head>
<body bgcolor="white" text="black">
<!-- Begin form code -->
<form name="form" method="post" action="update_entry.asp">
Content:
<textarea name="content" WRAP rows="4" cols="50"><%=
rsHome("content") %></textarea>
<input type="hidden" name="home_ID" value="<% = rsHome("home_ID")
%>">
<input type="submit" name="Submit" value="Submit">
</form>
<!-- End form code -->
</body>
</html>
<%
'Reset server objects
rsHome.Close
Set rsHome = Nothing
Set adoCon = Nothing
%>
Can anyone shed some light on my problem or do you need more info?
Thanks for your time.
Mike
field is a text box but if it's a textarea it just appears blank.
Here's my code on my edit page:
<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsHome 'Holds the recordset for the record to be updated
Dim strSQL 'Holds the SQL query for the database
Dim lngRecordNo 'Holds the record number to be updated
'Read in the record number to be updated
lngRecordNo = CLng(Request.QueryString("ID"))
'Create an ADO connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less
connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("homep.mdb")
'Set an active connection to the Connection object using DSN
connection
'adoCon.Open "DSN=guestbook"
'Create an ADO recordset object
Set rsHome = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an SQL statement to query the
database
strSQL = "SELECT homepc.* FROM homepc WHERE home_ID=" & lngRecordNo
'Open the recordset with the SQL query
rsHome.Open strSQL, adoCon
%>
<html>
<head>
<title></title>
</head>
<body bgcolor="white" text="black">
<!-- Begin form code -->
<form name="form" method="post" action="update_entry.asp">
Content:
<textarea name="content" WRAP rows="4" cols="50"><%=
rsHome("content") %></textarea>
<input type="hidden" name="home_ID" value="<% = rsHome("home_ID")
%>">
<input type="submit" name="Submit" value="Submit">
</form>
<!-- End form code -->
</body>
</html>
<%
'Reset server objects
rsHome.Close
Set rsHome = Nothing
Set adoCon = Nothing
%>
Can anyone shed some light on my problem or do you need more info?
Thanks for your time.
Mike