- Joined
- Feb 18, 2011
- Messages
- 1
- Reaction score
- 0
Hi,
This is my first project and Im connecting my MS SQL database with classic ASP. I got the connection string and its working, thats at least what i think because it was giving me a 500 internal server problem before but now its not. In fact its giving me a blank page. I was wondering if it really is working or not. I want it to connect to another asp page and return a "success" message if it works fine.
the code is
<add name="strConn" connectionString="Data Source=Name\SQLEXPRESS;Initial
Catalog=my_database.mdf;Integrated Security=false;User ID=sa;Password=xxxxxxx"
phoneNumber = request.QueryString("PhoneCode") + request.QueryString("text6")
custName = request.QueryString("CustFname") +" "+ request.QueryString("CustLname")
sql="Insert into suggestions (name, senderemail, telephone, mobile) values ('"& custName &"','" & request.QueryString("CustEmail") &"', )"
conn.Execute(sql)
conn.close
set sql = Nothing
'Set myMail=CreateObject("CDO.Message")
'myMail.From="(e-mail address removed)"
'myMail.To="(e-mail address removed)"
'//////////////////////////////////////////////////////////////////////
if Mailer.SendMail then
Response.Write "Mail sent..."
else
Response.Write "Mail send failure. Error was " & Mailer.Response
end if
response.Redirect("successMessage.asp")
/>
This is my first project and Im connecting my MS SQL database with classic ASP. I got the connection string and its working, thats at least what i think because it was giving me a 500 internal server problem before but now its not. In fact its giving me a blank page. I was wondering if it really is working or not. I want it to connect to another asp page and return a "success" message if it works fine.
the code is
<add name="strConn" connectionString="Data Source=Name\SQLEXPRESS;Initial
Catalog=my_database.mdf;Integrated Security=false;User ID=sa;Password=xxxxxxx"
phoneNumber = request.QueryString("PhoneCode") + request.QueryString("text6")
custName = request.QueryString("CustFname") +" "+ request.QueryString("CustLname")
sql="Insert into suggestions (name, senderemail, telephone, mobile) values ('"& custName &"','" & request.QueryString("CustEmail") &"', )"
conn.Execute(sql)
conn.close
set sql = Nothing
'Set myMail=CreateObject("CDO.Message")
'myMail.From="(e-mail address removed)"
'myMail.To="(e-mail address removed)"
'//////////////////////////////////////////////////////////////////////
if Mailer.SendMail then
Response.Write "Mail sent..."
else
Response.Write "Mail send failure. Error was " & Mailer.Response
end if
response.Redirect("successMessage.asp")
/>