Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET VB.NET
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.

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 & " "
Posted 9-Aug-12 8:16am
Edited 9-Aug-12 8:23am
(no name)20.4K
Kenneth Haugland at 9-Aug-12 13:50pm
Missing ' in the PositionID parameters?
Wes Aday at 9-Aug-12 14:09pm
Would be easier to take this and paste it into a query in your access db.
Kschuler at 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 at 9-Aug-12 15:24pm
its only the status value that is not updating, the rest is ok
Kschuler at 9-Aug-12 15:40pm
so what value are you trying to set it to?
mayeso at 9-Aug-12 15:46pm
thanks managed to solve it
mayeso at 9-Aug-12 15:45pm
solved it
AlluvialDeposit at 9-Aug-12 16:22pm
Your code is vulnerable for sql injections..

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

  Print Answers RSS
0 Sascha Lefévre 510
1 Sergey Alexandrovich Kryukov 300
2 Abhinav S 255
3 Maciej Los 210
4 Richard Deeming 105
0 Sergey Alexandrovich Kryukov 6,928
1 OriginalGriff 6,381
2 Maciej Los 2,782
3 Abhinav S 2,732
4 Peter Leow 2,694

Advertise | Privacy | Mobile
Web01 | 2.8.150414.1 | Last Updated 9 Aug 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100