Forum Moderators: open
can you help with with this bit of code that I have done. It's a form where the user gives me all the info and it gets put into a database.
Problem is im new and trial and error is my moto but im getting into difficulty here. How should I end my asp page.
I have declared my dims
I have declared my fields on my form
I have told it what database it's to put the info
I have then closed my connection string.
I'm having trouble with the end if statement. I keep getting an error up saying
expected statement
line 67
end if
here's my code below.....can someone please advise me :-)
Thanks
Set cn = Server.CreateObject("ADODB.Connection")
cn.ConnectionString = connStr
cn.Open
sql="INSERT into tbl_monthdraw(title, f_name, s_name, address, town, county, country, postcode, home_telephone, "&_
"work_telephone, mobile, email, DOB,, gender, drink_bottle, when_drink, brands, other, contact, date_entered)"&_
"VALUES ('" & title & "', '" & f_name & "', '" & s_name & "', '" & address & " " & town & "', '" & county &_
"', '" & country & "', '" & postcode & "', '" & home_telephone & "', '" & work_telephone & "', '" & mobile &_
"', '" & email & "', '" & DOB & "', '" & gender &_
"', '" & drink_bottle & "', '" & when_drink & "', '" & brands & "', '" & other & "', '" & contact & "', getdate())"
cn.execute(sql)
Set cn = Nothing
end if
%>
<% Response.Redirect("../share/thanks.asp") %>
you're right.....sometimes you just get something into your head and get tunnel vision.
i've taken the end if statement out and got a different error!
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near ','.
/dev/script/process.asp, line 67
I must have a pesky ' somewhere I shouldn't have.....wish me luck finding it :-)
Thanks for you help