Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

HELP!!! Where is my error?

Sub UpdateEmployee(ID, FName, LName, Dept, Loc, Title)
set conn = server.createobject ("adodb.connection")
conn.open "DataSource"
conn.Execute "update Employees set " _
& "EmpFirstName = '" & FName & "', " _
& "EmpLastName = '" & LName & "', " _
& "DepartmentID = '" & Dept & "', " _
& "LocationID = '" & Loc & "', " _
& "TitleID = '" & Title & "', " _
& "where EmployeeID = " & ID
End Sub

I keep getting a syntax error when I try to update a record. Can someone lead me in the right direction on this?

Comments

  • Anjuna MoonAnjuna Moon Member Posts: 89


    "TitleID = '" & Title & "', " _

    The comma (,) in the row above has to be removed. That's the only error I found in your code.
    /Chris
  • Justin BibJustin Bib USAMember Posts: 0

    _________ ( http://forcoder.org ) free ebooks and video tutorials about { C#, MATLAB, JavaScript, C, Python, Objective-C, Swift, Delphi, PHP, Java, Assembly, R, Scratch, Visual Basic .NET, Perl, Visual Basic, C++, PL/SQL, Ruby, Go Scala, Prolog, Clojure, Fortran, Logo, Dart, Ada, ML, Transact-SQL, LabVIEW, Julia, FoxPro, Bash, VBScript, SAS, F#, Erlang, Crystal, ABAP, Lisp, Scheme, Hack, Rust, Kotlin, Apex, Lua, Awk, Alice, COBOL, D }

Sign In or Register to comment.