Simple question, please help! 
Author Message
 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.



Sat, 16 Mar 2002 03:00:00 GMT  
 Simple question, please help!
Hello,

I never use FP WebBot when I program ASP connection to database, the
performance is not really good
I prefer to write directly database connection using ADO.

To answer your question regarding automatic page generation there is a good
article in aspwatch.com. Address :
http://www.aspwatch.com/c/199928/dD0B7C0D615D711D3AFB300A0CC40290A.asp

Hope this help

Philippe



Quote:
> 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.



Wed, 20 Mar 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Simple question, please help!

2. a simple question, please help

3. Simple question, Please Help!!! :)))

4. Simple question...please help

5. A simple question - please help

6. Simple Question, Please help!!! :)))

7. Very simple question - PLEASE HELP !!! :-)

8. Simple question, please help?!

9. MDI simple questions - please help

10. Simple question - please help me arghhh!!!!!!!!

11. SIMPLE SIMPLE ListView Question. Please help

12. Please help - Simple question

 

 
Powered by phpBB® Forum Software