Click here to Skip to main content
15,936,122 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have the following "insert into" sql query in ms access, everything in the query is able to insert data in the table except "status".I dont know if i have misplaced the qoutes.

C#
UPDATE [Staff] SET [Surname]='" & Surname(0) & "',[FirstName]='" & FirstName(0) & "',[Sex]='" & Sex(0) & "',[EmploymentNo]='" & EmploymentNo(0) & "'" & DateOfIssueString1 & ",[Yearofbirth]=" & YearOfBirth(0) & ",[EducationID]=" & EducationID(0) & ",[PositionID]=" & PositionID(0) & " " & CurrentPositionDateString1 & ",[Status]='" & Status(0) & "' WHERE [StaffID]=1 AND [DCID]=" & DCID & " "
            DAL.MyExecuteQuery(Sql)
Posted
Updated 9-Aug-12 7:23am
v2
Comments
Kenneth Haugland 9-Aug-12 13:50pm    
Missing ' in the PositionID parameters?
[no name] 9-Aug-12 14:09pm    
Would be easier to take this and paste it into a query in your access db.
Kschuler 9-Aug-12 14:22pm    
Are you getting an error or is it just not updating? Can you give us the exact string that is actually being used to query instead of this code? In other words, debug it and see what values are in each of those variables that you are concating or better yet, just quickwatch the whole string to see its final value.
mayeso 9-Aug-12 15:24pm    
its only the status value that is not updating, the rest is ok
Kschuler 9-Aug-12 15:40pm    
so what value are you trying to set it to?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900