-
I'm getting an error in the conn.execute line for this sub:
Sub Addrecord
dim start
dim startd
dim sql
dim objConn
start = Request.Form ("startm") & chr(47) & Request.Form ("startd") & chr(47) & Request.Form ("starty")
startd = CDate(start)
sql = "INSERT INTO vtvemployee (emp_fname,emp_sname,emp_dept,emp_salary,emp_hrspw,emp_stdrate,emp_start,emp_holiday) VALUES ('" & Request.Form ("fname") & "','" & Request.Form ("sname") & "','" & Request.Form ("dept") & "','" & Request.Form ("salary") & "','" & Request.Form ("hrspw") & "','" & Request.Form ("stdrate") & "','" & startd & "','" & Request.Form ("holiday") & "')"
set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=uid;Initial Catalog=Intranet;Data Source=INTRANET"
objConn.Execute sql,,adcmdtxt
It's really wierd because it was working fine on friday when I had a few extra values and fields to fill. Now I have removed them it has stopped working! Can anyone see what is wrong with it? I also removed the same fields from other subs for searching and editing but they work fine.
Any ideas?
-
Maybe the fields that you have left out require a value?
If not, what is the error you are getting?
Nialler
-
the fields i removed i also removed from the sql table so there shouldn't be any reference to them.
The error is
error '80040e14'
/hr/default.asp, line 175
where line 175 is the objConn.execute command
it's a really cryptic error which is what has been holding me up. Any ideas?
-
The command text contained one or more errors— typically a syntax error or unexpected keyword. The error string should contain the unexpected token
Check the error string for the Error...
Sonia
-
sorry i've only been coding asp for a few weeks. how do i check the error string?
Is there a way to get more information from those odd numbers?