Andrew said:
John,
Is this tracking system to be something that the user (your clients)
will view, or something just for your own benefit?
I have made a similar thing, like you're after.
Try
www.murraywebs.com. Log on as username: "Guest" and pwd: "guest"
then go to the "List maintenance items completed or in progress" link.
I did this with just the FP database results wizard, it is nothing
spectacular, but does what I want. I suppose you want a similar
thing.
Andrew,
Perhaps you can also help me.
I created a guestbook on the site below.
I can display, add to, and delete from it, but I am having trouble modifying
it. I have posted queries on another newsgroup, but you seem to have
resolved my problem already.
This is the code generated by ASP to accept an update an call the ASP to
update the DB
<form name="form">
<table width="100%" border="1">
<thead>
<tr bgcolor="aqua">
<th colspan="4"><b>Click ID to update entry</b></th>
</tr>
<tr bgcolor="silver">
<th align="left"><b>ID</b></th>
<th align="left"><b>Name</b></th>
<th align="left"><b>Comments</b></th>
<th align="left"><b>Timestamp</b></th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="update_entry.asp?ID=1"</a>1</td>
<td><input type="text" name="name" maxlength="50" value=" "></td>
<td><textarea name="comments" cols="50" rows="10"> </textarea></td>
<td>25-08-2006 01:18:48</td>
</tr>
<tr>
<td><a href="update_entry.asp?ID=10"</a>10</td>
<td><input type="text" name="name" maxlength="50" value="Alex"></td>
<td><textarea name="comments" cols="50" rows="10">Hi,I wish I had the
patience to make my sites as good as yours, your site is excellent.Thanks
for a good job. ,</textarea></td>
<td>06-09-2006 12:41:33</td>
</tr>
</tbody>
</table>
</form>
update_entry.asp is
<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsUpdateEntry '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 object
Set adoCon = Server.CreateObject("ADODB.Connection")
'Open the connection
adoCon.Open Application("guestbook_ConnectionString")
'Create an ADO recordset object
Set rsUpdateEntry = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT * FROM Results WHERE ID=" & lngRecordNo
'Set the cursor type we are using so we can navigate through the recordset
rsUpdateEntry.CursorType = 2
'Set the lock type so that the record is locked by ADO when it is updated
rsUpdateEntry.LockType = 3
'Open the tblComments table using the SQL query held in the strSQL varaiable
rsUpdateEntry.Open strSQL, adoCon
'Update the record in the recordset
rsUpdateEntry.Fields("name") = Request.Form("name")
rsUpdateEntry.Fields("comments") = Request.Form("comments")
'Write the updated recordset to the database
rsUpdateEntry.Update
'Reset server objects
rsUpdateEntry.Close
Set rsUpdateEntry = Nothing
Set adoCon = Nothing
'Return to the update select page incase another record needs deleting
Response.Redirect "update_guestbook.asp"
%>
When I enter some details into record 1 and click the link, the fields are
set to blank.
Can you see what is wrong?
Perhaps the code which you use in
http://www.murraywebs.com/maintenance.asp?mode=Modify&name=Guest&client=Guest
is the answer
I see you have:
<form method="POST" action="maintenance.asp" name="maintenance"
webbot-action="--WEBBOT-SELF--">
and a submit button
whereas I have
<form name="form">
and each entry has
<a href="update_entry.asp?ID=1"</a>1
I doubt that this matters as update_entry.asp is definitely being called
without error. I think the problem lies in the code in "update_entry.asp"
I have also tried with no success:
<form name="form" method="POST" action="--WEBBOT-SELF--">
What does your file "maintenance.asp" look like?
BTW,
I prefer not to rely on webbots, but to use the actual ASP code if at all
possible