Mike said:
Great..I did that and it will work fine thanks!
One question though, Is there a way to access and edit/clear the log
if need be? Like if someone changes their mind. I did a test and
unfortunately it saved the jargon I placed in there as test comments.
Hmm,
What you probably need is to delete specfic entries.
I have set up a guesbook on my site with View, Search, Add, Update and
Delete. But after some experimentation with the Wizard, I stopped using it
and set up the code myself.
Does the Wizard have an option for Delete Entry?
If not, I could try to post some code here. What you need to do is to
identify the ID of the record you want to delete and pass this ID via a form
to code like this
Or, if there is only one record, you could hard code the ID, e.g.
Change
lngRecordNo = CLng(Request.Form("id"))
to
lngRecordNo = 1
if 1 is the ID of the test record
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Guestbook Delete Entry</title>
</head>
<body>
<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsDeleteEntry 'Holds the recordset for the record to be deleted
Dim strSQL 'Holds the SQL query for the database
Dim lngRecordNo 'Holds the record number to be deleted
'Read in the record number to be deleted
lngRecordNo = CLng(Request.Form("id"))
'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")
'Open the connection
adoCon.Open Application("guestbook_ConnectionString")
'Create an ADO recordset object
Set rsDeleteEntry = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT Results.* FROM Results WHERE ID=" & lngRecordNo
'Set the lock type so that the record is locked by ADO when it is deleted
rsDeleteEntry.LockType = 3
'Open the recordset with the SQL query
rsDeleteEntry.Open strSQL, adoCon
'Delete the record from the database
rsDeleteEntry.Delete
'Reset server objects
rsDeleteEntry.Close
Set rsDeleteEntry = Nothing
Set adoCon = Nothing
%>
</body>
</html>
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website:
http://trevorl.mvps.org/