
Simple question, please help!
Hi,
I would like to use ASP and MS-Access to automatically generate web
pages for me. I would like to have my web pages formate similar to
newspaper. The editors write articles in the article submitting form,
and articles will save to MS-Access database, and ASP will generate
headlines (first 50 characters) of the article on the headline page
and have "more" links to the full article. I use Frontpage 2000 to
generate the form page and database connection for me. I would like
to add another field in the database table to keep the first 50
characters of the article, so the headline page can simply request
this field and post on the net. Here is what Frontpage did for me...
<%
....
fp_rs.AddNew
FP_DumpError strErrorUrl, "Cannot add new record set to the database"
Dim arFormFields0(3)
Dim arFormDBFields0(3)
arFormFields0(0) = "body" #This is 3 fields I have in my form
arFormDBFields0(0) = "body"
arFormFields0(1) = "title"
arFormDBFields0(1) = "title"
arFormFields0(2) = "category"
arFormDBFields0(2) = "category"
FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0
FP_SaveFieldToDB fp_rs, Left(Request.Form("body"),50), "short_body"
# I add this line and hoping it would take first 50 characters of body
field and save it to short_body field
If Request.ServerVariables("REMOTE_HOST") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_HOST"),
"Remote_computer_name"
End If
If Request.ServerVariables("HTTP_USER_AGENT") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("HTTP_USER_AGENT"),
"Browser_type"
End If
FP_SaveFieldToDB fp_rs, Now, "Timestamp"
If Request.ServerVariables("REMOTE_USER") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_USER"),
"User_name"
End If
....
%>
And in the HTML, FrontPage did the following...
<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveDatabase" startspan SuggestedExt="asp"
U-ASP-Include-Url="../_fpclass/fpdbform.inc"
S-DataConnection="new_page_1"
S-RecordSource="Results" U-Database-URL="../fpdb/new_page_1.mdb"
S-Builtin-Fields="REMOTE_HOST HTTP_USER_AGENT Timestamp REMOTE_USER"
S-Builtin-DBFields="Remote_computer_name Browser_type Timestamp
User_name short_body"
S-Form-Fields="body title category" S-Form-DBFields="body title
category" --><input TYPE="hidden" NAME="VTI-GROUP"
VALUE="0"><!--#include file="../_fpclass/fpdbform.inc"--><!--webbot
bot="SaveDatabase" endspan -->
...
I wasn't sure what's the difference between S-Builtin-Fields and
S-Form-Fields, and what I have to do with short_body field since it's
not in the Form, and it's not Buildin-Fields neither. Is there
another declearation I have to do for short_body here?
Please help! thank you.