Frontpage ASP + Form properties

J

jf

Hello,

I have a webpage with an ASP form. I need to send the results to an Access
database and it doesn't work. How should I do.
If you have any suggestions :)

Thank you
 
D

David Berry

What's not working? What's the code you're using. Are you getting the
values from Request.Form and then doing an insert into the database?
 
J

jf

I have a form created in Frontpage and a database created in access with the
name of volourproject.mdb
I can enter the data in my form on the web without any problem and submit it
, but when I want to access to the data on my access database linked with the
records of the form it doesnt work, the database don't show any results.

here is the code

<%
' FP_ASP ASP Automatically generated by a Frontpage Component. Do not Edit.

On Error Resume Next
Session("FP_OldCodePage") = Session.CodePage
Session("FP_OldLCID") = Session.LCID
Session.CodePage = 1252
Err.Clear

strErrorUrl = ""

If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
Err.Clear

Set fp_conn = Server.CreateObject("ADODB.Connection")
FP_DumpError strErrorUrl, "Cannot create connection"

Set fp_rs = Server.CreateObject("ADODB.Recordset")
FP_DumpError strErrorUrl, "Cannot create record set"

fp_conn.Open Application("volhourproject_ConnectionString")
FP_DumpError strErrorUrl, "Cannot open database"

fp_rs.Open "Results", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic,
adCmdTable
FP_DumpError strErrorUrl, "Cannot open record set"

fp_rs.AddNew
FP_DumpError strErrorUrl, "Cannot add new record set to the database"
Dim arFormFields0(12)
Dim arFormDBFields0(12)
Dim arFormValues0(12)

arFormFields0(0) = "S1"
arFormDBFields0(0) = "S1"
arFormValues0(0) = Request("S1")
arFormFields0(1) = "Org_Name"
arFormDBFields0(1) = "Org_Name"
arFormValues0(1) = Request("Org_Name")
arFormFields0(2) = "emailfrom"
arFormDBFields0(2) = "emailfrom"
arFormValues0(2) = Request("emailfrom")
arFormFields0(3) = "Types"
arFormDBFields0(3) = "Types"
arFormValues0(3) = Request("Types")
arFormFields0(4) = "Hours1"
arFormDBFields0(4) = "Hours1"
arFormValues0(4) = Request("Hours1")
arFormFields0(5) = "email_subject"
arFormDBFields0(5) = "email_subject"
arFormValues0(5) = Request("email_subject")
arFormFields0(6) = "Hours2"
arFormDBFields0(6) = "Hours2"
arFormValues0(6) = Request("Hours2")
arFormFields0(7) = "Phone_Number"
arFormDBFields0(7) = "Phone_Number"
arFormValues0(7) = Request("Phone_Number")
arFormFields0(8) = "page_after_email"
arFormDBFields0(8) = "page_after_email"
arFormValues0(8) = Request("page_after_email")
arFormFields0(9) = "Contact_Person"
arFormDBFields0(9) = "Contact_Person"
arFormValues0(9) = Request("Contact_Person")
arFormFields0(10) = "email_to_address"
arFormDBFields0(10) = "email_to_address"
arFormValues0(10) = Request("email_to_address")
arFormFields0(11) = "Comments"
arFormDBFields0(11) = "Comments"
arFormValues0(11) = Request("Comments")

FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0

If Request.ServerVariables("HTTP_USER_AGENT") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("HTTP_USER_AGENT"),
"Browser_type"
End If
If Request.ServerVariables("REMOTE_HOST") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_HOST"),
"Remote_computer_name"
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

fp_rs.Update
FP_DumpError strErrorUrl, "Cannot update the database"

fp_rs.Close
fp_conn.Close

FP_FormConfirmation "text/html; charset=windows-1252",_
"Form Confirmation",_
"Thank you for submitting the following information:",_
"volhourproject.asp",_
"Return to the form."

End If
End If

Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")
 
J

jf

this database is in the fpdb folder and I dont have any errors reported while
opening the database or clicking the submit button.
 
D

David Berry

So you're saying that the insert works fine but the problem is in retrieving
and displaying the results?

What's the SQL Statement or code that you're using to display the results?
Did you test out the SQL in Access to see if it returns results?
 
J

jf

I found the problem.
It was that the he file level permissions were not set correctly. I
modified the permissions and it works fine.
ty

Johan
 
D

David Berry

Glad to hear you're all set.


jf said:
I found the problem.
It was that the he file level permissions were not set correctly. I
modified the permissions and it works fine.
ty

Johan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top