I'm having some problems connecting to a MS SQL database. I'm trying to use a DSN-less connection using ASP/ADO. Here's the code, minus the login info:
Any help would be much appreciated!
Code:
<%
db_server = "foo"
db_name = "foo"
db_username = "foo"
db_userpassword = "foo"
tablename = "foo"
var oConn = Server.CreateObject("ADODB.Connection")
oConn.Open("Driver={SQL Server};SERVER=" & db_server & ";DATABASE=" & db_name & ";UID=" & db_username & ";PWD=" & db_userpassword)
strSql = "INSERT INTO customers (ID,first_name,last_name,address,city,state,zip,phone,cell,email,DOB,pickup_front,pickup_side,pickup_back,pickup_other,drop_front,drop_side,drop_back,drop_other,delivery_options,shirt_hangers,shirt_fold,starch_no,starch_light,starch_medium,starch_heavy,clean_instructions,cc_name,cc_type,cc_number,cc_exp) VALUES('" & first_name & "','" & last_name & "','" & address & "','" & city & "','" & state & "','" & zip & "','" & phone & "','" & cell & "','" & email & "','" & DOB & "','" & pickup_front & "','" & pickup_side & "','" & pickup_back & "','" & pickup_other & "','" & drop_front & "','" & drop_side & "','" & drop_back & "','" & drop_other & "','" & delivery_options & "','" & shirt_hangers & "','" & shirt_fold & "','" & starch_no & "','" & starch_light & "','" & starch_medium & "','" & starch_heavy & "','" & cleaning_instructions & "','" & cc_name & "','" & cc_type & "','" & cc_number & "','" & cc_exp & "')"
oConn.Execute(strSql)
oConn.Close
var oConn = Nothing
%>
Any help would be much appreciated!





