Results 1 to 5 of 5

Thread: hellppp mee pls...

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Location
    London
    Posts
    11
    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?

  2. #2
    Member
    Join Date
    Jan 2001
    Location
    Dublin
    Posts
    35
    Maybe the fields that you have left out require a value?

    If not, what is the error you are getting?

    Nialler

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Location
    London
    Posts
    11
    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?

  4. #4
    Lively Member harsoni's Avatar
    Join Date
    Oct 2000
    Posts
    118
    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

  5. #5

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Location
    London
    Posts
    11
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width