Problem I have is that I can email info in my form but can't get data into an access database. I get NO error messages and log shows nothing either. I have created an ODBC entry to my database "H10_sun", and placed my database contacts.mdb under my sites's root directory.
The form is here...
http://plumpix.com/form2.htm
ASP code is here ...
http://plumpix.com/aspfile2.htm
Access table pretty much looks like this ...
http://plumpix.com/table.htm
Any help appreciated.
Roy
russell
10-16-2006, 09:25 PM
1. you aren't executing your sql
2. nothing else gets executed after your response.redirect
3. the on error resume next will suppress error messages, making it impossible to debug, should comment that out when testing/developing
4. the sql insert is all weird and you aren't inserting the form values.
5. you have an extra end if at the end -- and remember that whole block after the redirect never gets executed anyway.
replace this line with everything below:
Sql = "INSERT INTO Contacts (Financing, Models, Spanish, First, Last, Phone, Comment, email, address, city, state, zip, timeline) VALUES ('%%chkFinancing%%','%%chkFloorPlans%%','%%chkSpanish%%','%%txtFirstName%%','%%txtLastName%%','%%txt Phone%%','%%txtComment%%','%%txtEmail%%','%%txtAddress%%','%%txtCity%%','%%selState%%','%%txtZip%%', '%%timeline%%')"
Dim chkFinancing
Dim chkFloorPlans
Dim chkSpanish
Dim txtFirstName
Dim txtLastName
Dim txtPhone
Dim txtComment
Dim txtEmail
Dim txtAddress
Dim txtCity
Dim selState
Dim txtZip
Dim timeline
Russell, many, many kudos. It works perfect with MySQL database. I had problem with Access, so I decided to abandon it and use MySQL. I am posting the final code for others to use... Thanks, Ron
<%
Dim Conn,sql
Dim chkFinancing
Dim chkFloorPlans
Dim chkSpanish
Dim txtFirstName
Dim txtLastName
Dim txtPhone
Dim txtComment
Dim txtEmail
Dim txtAddress
Dim txtCity
Dim selState
Dim txtZip
Dim timeline
' database connection
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "H10_sun"
' change to address of your own SMTP server
strHost = "100.1.1.181"
strRecepient = "myemail@yahoo.com"
If Request("Send") <> "" Then
Set Mail = Server.CreateObject("Persits.MailSender")
' enter valid SMTP host
Mail.Host = strHost