Click here to Skip to main content
12,077,332 members (45,564 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB 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 & " "
            DAL.MyExecuteQuery(Sql)
Posted 9-Aug-12 8:16am
mayeso656
Edited 9-Aug-12 8:23am
v2
Comments
Kenneth Haugland 9-Aug-12 13:50pm
   
Missing ' in the PositionID parameters?
Wes Aday 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?
mayeso 9-Aug-12 15:46pm
   
thanks managed to solve it
mayeso 9-Aug-12 15:45pm
   
solved it
AlluvialDeposit 9-Aug-12 16:22pm
   
Your code is vulnerable for sql injections.. http://www.codeproject.com/Articles/425150/Beginners-guide-to-a-secure-way-of-storing-passwor#sqlinjections

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web04 | 2.8.160212.1 | Last Updated 9 Aug 2012
Copyright © CodeProject, 1999-2016
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