DB update Error

Hi
I tried to update a document but keep getting this error " java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in
UPDATE statement." I checked my update statements for any missing " or ' but everything seem ok.Anyone know what will be the likely reason behind this?? Thanks in advance
DocMgr mgr = new DocMgr();
int modDoc = mgr.modDoc("2","John","test","300803","file.txt","3","this is a test");
[DocMgr.java]
public int modDoc(String docNo , String name , String title , String date , String path , String docType,String comment)
          System.out.println("entering modDoc");
          try{
               long res = db.UpdateSQL(doc.updateDocument(docNo , name , title , date , path ,docType ,comment));
               System.out.println("Change rs value is"+""+res);
               return (int)(res);     
          }catch(Exception e){System.out.println(e);}
          return -1;
[Document.java]
doc = new Documents();
public String updateDocument(String docNo , String name , String title , String date , String path , String docType ,String comment)
String updateString= " UPDATE Document SET "+ "Name= '"+name+"', "+ "Title= '"+title+"', Date = '"+date+"', Path= '" +path+"' , DocumentType= '"+docType+"' , Comment='"+comment+"' WHERE DocNo ='" + docNo + "'";
return updateString;

DanishHussain is correct replace ' with '' (1 singe quote with 2 single quotes).
UPDATE Document SET Name= 'something with'<-this is a sinle quote and would case an error' ...
should be:
UPDATE Document SET Name= 'something with''<-this are 2 sinle quotes and would not case an error' ...
Not only could not replacing ' with '' cause an error it leaves your database open for SQL insertion (someone hacking onto your database)
http://www.sensepost.com/misc/SQLinsertion.htm
... , Title= '', Date = '', Path= '' , DocumentType= '' , Comment='' WHERE DocNo =''
The values DocumentType (if the DB is well formed and it's a foreighn key) and docNo should be numerical values so leave out the '' here.

Similar Messages

  • Windows Vista update error code 80070490

    Hi there,
    Can anyone help me with this issue! I've tried everything under the sun to fix this problem so I'm hoping you's more in the know than myself can help!!??

    Hi
    This Vista update problem seems to be known to Microsoft:
    +If you receive Windows Update error 80070490, it means that a file (CBS Manifest) that's needed to install updates is corrupt. To correct this problem, you'll need to repair Windows. Repairing Windows won't damage your personal files or the programs that are installed on your computer.+
    Here more details how to fix this issue:
    [Windows Update error 80070490|http://windows.microsoft.com/en-us/windows-vista/windows-update-error-80070490]

  • Windows Vista Update Error 80072EFD

    got Vista Home Premium 32bit and updates were running smooth till January. In Feb- March updates just stopped to work due error code 80072EFD. Have tried with Fixit ( doesn't work as well ) got an error 8004FE2C, and Win Defender got  the same error
    as updates 80072EFD. My laptop is without viruses ( have ESET Smart Security ) and no maleware ( have Malewerebytes ). Already had  checked all Win Update services were they running, then resetting them and added the links of microsoftupdates.com in ESET
    and Explorer ( preventing form blocking the site) even closed all firewalls and security.....without any success. Still got the same error  80072EFD!! 
    Can u please help ! :( 

    Try to use the below to see if it helps http://windows.microsoft.com/en-sg/windows/windows-update-error-80072efd#1TC=windows-7 And try resetting the windows update components http://support.microsoft.com/kb/971058
    Http://blog.theinfraguys.com | Please remember to click “Mark as Answer” on my answer if it helps. :)

  • Windows Vista- Update Error 80044016

    Good afternoon!
    Friend of mine is struggling with Windows Vista SP 2 - Windows Update.
    So far I tried to:
    -Disable AV, Disable Firewall
    -Clean boot
    -Automated solution - fix it
    -Sfc
    -checksur
    -re-register responsible dll's
    regsvr32 wuapi.dll
    regsvr32 wuaueng.dll
    regsvr32 atl.dll
    regsvr32 wucltui.dll
    regsvr32 wups.dll
    regsvr32 wuaueng1.dll
    regsvr32 wucltui.dll
    regsvr32 wups.dll
    regsvr32 wuweb.dll
    regsvr32 wups2.dll
    regsvr32 msxml.dll
    regsvr32 msxml3.dll
    regsvr32 msxml2.dll
    regsvr32 qmgr.dll
    regsvr32 qmgrprxy.dll
    -currently running Malicous software removal from safe mode in case of possible hijack.
    -PC is not under domain influence or behind proxy.
    Fact is this occured after clean install. He tried to reinstal it again and issue persists.
    Could you please check windowsupdate.log bellow and try to tell me what should be my next step?
    Due to the fact that my account is not verified yet, I can't post log here therefore I've chosen pastebin as the best location.
    pastebin.com//WJDzA6eq
    Thank you very much!

    Also I wanted to tell that Update error code is : 80044016
    Regards,
    Chrobak77

  • Media Encoder CC (2014) Update Error (U44M1P34)

    Just did a batch of CC updates and Media Encoder CC (2014) failed with error U44M1P34. Any suggestions on how to fix this?

    U44.. update error http://forums.adobe.com/thread/1289956 may help
    -more U44.. discussion http://forums.adobe.com/thread/1275963
    -http://helpx.adobe.com/creative-suite/kb/error-u44m1p7-installing-updates-ccm.html
    -http://helpx.adobe.com/creative-suite/kb/error-u44m1i210-installing-updates-ccm.html
    or
    A chat session where an agent may remotely look inside your computer may help
    Creative Cloud chat support (all Creative Cloud customer service issues)
    http://helpx.adobe.com/x-productkb/global/service-ccm.html

  • Windows 7 PRO GP update error

    Windows 7 PRO GP update error        
    We have a very peculiar problem
    We have a Primary  DC & Secondary DC installed in all our office ( Windows 2008R2). The Domain name is abc.com for all the Offices and the replication between the DC's happen in between the office happen without a problem.
    The clients in each of the offices gets authenticated from the DC in the respective office.
    But for a group policy update it gives an error as below
    "Computer policy could not be updated successfully.  The following errors were encountered: The processing of Group Policy failed.  Windows attempted to read the file
    \\<FQDN>\sysvol\<FQDN>\Policies\{BD732AAF-016F-11D2-945F-00C04Fb984F9}\gpt.inifrom a domain controller and was not successful.  Group Policy settings may not be applied until this event is
    resolved. This issue may be transient and could be caused by one or more of the following:
    a) Name Resolution/Network Connectivity to the current domain controller.
    b) File Replication Service Latency (a file created on another domain controller has not replicated to the current domain controller).
    c) The Distributed File System (DFS) client has been disabled.
    The error happens only on some clients.
    We are able to Ping, connect to the local DC and the client gets the IP from the local DC and also gets authenticated by the local DC for log on.
    On the PC which gives an error if we try to ping domain name - abc.com it returns the ip of the DC in a another office and not the local DC.
    Request to suggest a solution / tips to identify the problem

    Thanks for your reply
    Please find the IPConfig Details  as requested
    Windows IP Configuration of CLIENT with Problem
       Host Name . . . . . . . . . . . . : NP
       Primary Dns Suffix  . . . . . . . : ALT.COM
       Node Type . . . . . . . . . . . . : Hybrid
       IP Routing Enabled. . . . . . . . : No
       WINS Proxy Enabled. . . . . . . . : No
       DNS Suffix Search List. . . . . . : ALT.COM
    Ethernet adapter Local Area Connection 2:
       Connection-specific DNS Suffix  . : ALT.COM
       Description . . . . . . . . . . . : Realtek PCIe GBE Family Controller
       Physical Address. . . . . . . . . : 00-19-99-F2-5B-BC
       DHCP Enabled. . . . . . . . . . . : Yes
       Autoconfiguration Enabled . . . . : Yes
       Link-local IPv6 Address . . . . . : fe80::bc5c:5976:37b2:d42a%14(Preferred)
       IPv4 Address. . . . . . . . . . . : 10.102.22.72(Preferred)
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Lease Obtained. . . . . . . . . . : Tuesday, July 08, 2014 8:02:23 AM
       Lease Expires . . . . . . . . . . : Wednesday, July 09, 2014 8:02:23 AM
       Default Gateway . . . . . . . . . : 10.102.22.1
       DHCP Server . . . . . . . . . . . : 10.102.10.10
       DHCPv6 IAID . . . . . . . . . . . : 318773657
       DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-19-FE-B8-99-00-19-99-F2-5B-BC
       DNS Servers . . . . . . . . . . . : 10.102.10.10  10.102.10.11
       Primary WINS Server . . . . . . . : 10.102.10.10
       NetBIOS over Tcpip. . . . . . . . : Enabled
    Tunnel adapter Teredo Tunneling Pseudo-Interface:
       Media State . . . . . . . . . . . : Media disconnected
       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
       Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
       DHCP Enabled. . . . . . . . . . . : No
       Autoconfiguration Enabled . . . . : Yes
    Tunnel adapter isatap.ALT.COM:
       Media State . . . . . . . . . . . : Media disconnected
       Connection-specific DNS Suffix  . : ALT.COM
       Description . . . . . . . . . . . : Microsoft ISATAP Adapter #2
       Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
       DHCP Enabled. . . . . . . . . . . : No
       Autoconfiguration Enabled . . . . : Yes
    ===========================================
    Windows IP Configuration on DC
       Host Name . . . . . . . . . . . . : ALTHODC03
       Primary Dns Suffix  . . . . . . . : ALT.COM
       Node Type . . . . . . . . . . . . : Hybrid
       IP Routing Enabled. . . . . . . . : No
       WINS Proxy Enabled. . . . . . . . : No
       DNS Suffix Search List. . . . . . : ALT.COM
    Ethernet adapter Local Area Connection:
       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : Intel(R) 82575EB Gigabit Network C
    on
       Physical Address. . . . . . . . . : 00-19-99-7E-7F-62
       DHCP Enabled. . . . . . . . . . . : No
       Autoconfiguration Enabled . . . . : Yes
       IPv4 Address. . . . . . . . . . . : 10.102.10.10(Preferred)
       Subnet Mask . . . . . . . . . . . : 255.255.255.224
       Default Gateway . . . . . . . . . : 10.102.10.1
       DNS Servers . . . . . . . . . . . : 10.100.10.10
                                           10.102.10.11
                                           127.0.0.1
       NetBIOS over Tcpip. . . . . . . . : Enabled
    Tunnel adapter isatap.{4353BDBD-759C-45E1-A523-621CC16121AA}:
       Media State . . . . . . . . . . . : Media disconnected
       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : Microsoft ISATAP Adapter
       Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
       DHCP Enabled. . . . . . . . . . . : No
       Autoconfiguration Enabled . . . . : Yes
    Tunnel adapter Teredo Tunneling Pseudo-Interface:
       Media State . . . . . . . . . . . : Media disconnected
       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
       Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
       DHCP Enabled. . . . . . . . . . . : No
       Autoconfiguration Enabled . . . . : Yes
    =======================================================
    We do not use Sysprep and also we normally do not use imaging
    Domain Time is in Sync with DC & Client

  • Open Delivery value update error in credit management

    Hi
    We have credit management active at delivery level. The value of open deliveries is not getting updated correctly for items with material substitution (material determination). For all other items, its getting updated correctly.
    E.g Let say the credit limit set in FD32 is 10000 and the credit limit used % is 98 and the credit exposure value is 9800.
    Now when I create an order with qty 10 for mat A, it creates a sub item B due to material determination and the value of the item is Rs.1200. In our system, the sub item with TAPS item category is relevant for pricing.
    Then I create a delivery in VL01N and save it.
    Now if i check in FD33, the credit limit used should be 101% and the credit exposure value should be 11000, but its not updating the open delivery value correctly. Its not considering the value of the new delivery.
    However, If I add a normal item (TAN) in the same sales order and create a delivery for that item and save it, its updating the credit exposure based on the value of the normal item in the delivery correctly.
    How to make the system update the open delivery values correctly by taking the items with material determination also into account.??
    Please advise if any specific settings need to be done.
    Regards
    Madhu

    Hi,
    the system updates open values for credit management. These are:
    Open sales order credit value (S066-OEIKW)
    Open delivery credit value (S067-OLIKW)
    Open billing document credit value (S067-OFAKW)
    The system updates the open values in standard SIS structures S066 and S067. Technically, the structures are transparent tables. You can display the contents using transaction SE16 or using table maintenance.
    The S067-OLIKW will give the open delivery credit values credit.Check in you system whether this table is updated with the delivery values for the credit account(customer number)
    RVKRED77 u2013 Reorganize SD credit data
    When updating errors occur, it enables you to reorganize the open credit, delivery and billing document values.
    If the table is not updated run this report in background.
    Regards,
    Saju.S

  • After last automatic update, error message XUL Runner error platform version '6.0.2' is not compatible with minVersion 6.0.1. maxVersion 6.0.1. I am unable to open Mozilla Firefox at all. Had to use Explorer to ask this question!

    After last automatic update, error message XUL Runner error platform version 6.0.2. is not compatible with min Version 6.0.1 maxVersion 6.0.1 appeared every time I try to open/run Mozilla Firefox.

    See:
    *[[/questions/869812]]
    *[[/questions/869951]]

  • Error while posting the  Idoc 'Update error, transaction VA01'

    Hi Gurus,
    When an inbound Idoc for sales order is trying  to post we  are  getting the  error 'Update error, transaction VA01'.
    Aslo following  are the  details of  the error:
    Update error, transaction VA01
    Message no. 00377
    Diagnosis
    An error occurred in CALL TRANSACTION USING or CALL DIALOG USING
    during a synchronous update.
    The error was caused by the transaction VA01.
    Update information
    Return code:        009
    Text       :        Error during insert table FPLTC (RC= 1, Key= )
    Procedure
    Pleas analyse your Batch-Input data.
    You can also examine your posting data using the transaction SM13.
    Can somebody let  me  know  what would  be  the cause.
    Also the  we are  trying  to post the  Idoc with a Id which is  having  maximum Authorization.

    Hi,
    Where you able to resolve your issue, I would appreciate if you can share the solution.
    Thanks

  • I am trying to update to iTunes 10.5 and am getting a Apple Software update error. "There is a problem with this Windows Installer Package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. ??

    I am trying to update to iTunes 10.5 and am getting a Apple Software update error. "There is a problem with this Windows Installer Package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. ?? I can't uninstall the Apple Software Update from my Control Panel. It states "Fatal error during installation" Please HELP!!!

    I am experiencing the exact same issue during the installtion process for iTunes 10.5.
    I uninstalled all Apple components but when I attempted to uninstall the Apple Software Update I received the same message: "Fatal error during installtion." I was able to repair the Apple Software Update but still could not install iTunes 10.5 afterwards.
    I have tried everything that I could find on these discussions pages as well as other suggestions on third party sites. I continue to receive the error message: "There is a problem with this Windows Installer Package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor.
    I was able to uninstall and reinstall QuickTime 7.7.1. During the reinstalltion process I received the same message (There is a problem with this Windows Installer Package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor.) But after clicking "OK" the installtion process was succesful. PLEASE HELP!

  • Update error while saving quotation

    update error while saving quotation - express message
    Error reads as "device type sapwin"
    When the print option send immediately (option 4) in the printer configuration the error is coming and the document is not saving due to update error.
    When the print option is send with own application (option 3) in the printer configuration the document is getting saved.
    we want to run with option 4.  could some one show some light on this problem.
    regards
    VS Arava

    From the description the job is trying to print to a frontend printer. Try sending the job to another printer. Or print to LOCL. This will send the spool to your local default printer.
    I suspect there is a network issue related to the printer set up.
    when you use option 4 the error gets hit immediately. Option three is waiting to print later, the error does not likely show up until later when the job is actually printed.
    Check the printer config..

  • Lion 10.7.1 update error = no sound , no mouse ...

    I have Lion 10.7.1 and i got update notification so i start update my os when its come to installation i got message  like "unknown error" and update of OS chrashed with some strange loud noise , then when it restarted i had no sound and my remote mouse don't work , it was all ok before update error.
    In Preference - Sound  there is no Output device ( i can plug in my suround my headspeakers and nothing happend). And my remote mouse not working. So i don't know is there enithing else not working but is seems all other ok.
    I don't have backup and i have a lot of work on my mac Book Pro 13" 2011 , so i need to fix it without reinstalation cos i  buy this because i was full of windows reinstalations ewery 3-4 months.
    Sorry for my bad English it is not my native language i am from Croatia.

    ok i solved this problem . First what was the problem ,it was permissions thet must be changed due to error upgrade of OSX.
    solution:
    1. restart PC , and when it start press option key (alt).
    2. it brings boot options , i have OSX lion , Windows , and now i got Rescue , chose Rescue ( or repair or what ewer you have to reinstall osX).
    3. you got some options to restore from backup , to reinstall, find help online , disk utility. Chose disk utility.
    4. in Disk utility chose to repair permissions. when thet finish restart pc.
    thet is what i did , and it fix me all. sound now work and USB 1 work too.
    I hope this will help someone.

  • ITunes update error 7 (windows error 1114) on Windows Vista Home Premium SP2

    I have been trying to update iTunes for the past month. I admit that I had not been keeping up with the updates for about a year but now that I want to update it, I am getting an error.
    Computer: hp Pavilion dv6700 Notebook PC, Intel Core2 CPU T8100 at 2.10 GHz
    OS: Windows Vista Home Premium, Service Pack 2
    iTunes update error 7 (Windows error 1114)
    error message from Windows:
    Runtime Error!
    Program: C:\Program Files\iTunes\iTunes.exe
    R6034 Application has made an attempt to load the C Runtime Library incorrectly. Please contact applications support (that is Apples iTunes) team for information.
    I am also getting C Runtime Library error message about once a day since I tried to update iTunes.
    What do I do?

    See Troubleshooting issues with iTunes for Windows updates.
    tt2

  • IPOD Updater - Error 1324 - The Folder path contains an invalid character

    I tried to install ITUNES on an external HD (I didn't want to slow down my computer by putting all of my music on my internal HD). ITunes installed and then crashed. I removed all traces of ITUNES and IPOD that I could find and went to install ITUNES again on my regular internal drive. Now it goes through the installation and REMEMBERS my IPOD serial number (so obviously I can't find all of the files to remove) but doesn't give me a choice of where to install (it still must be trying to install to my external HD) the ITUNES. All I get is the following Error message:
    IPOD Updater - Error 1324 - The Folder path "Program Files" contains an invalid character
    Does anyone have a solution out there?
    Thanks in advance!
    MonsterProb

    IPOD Updater - Error 1324 - The Folder path "Program Files" contains an invalid character
    Interesting. It's choking on the old iPod updater application. (iPod software updates are no longer handled by a standalone application ... that function was folded into iTunes beginning with iTunes 7.0.0.70.)
    Let's try the following procedure.
    Download and install the Windows Installer CleanUp utility:
    Description of the Windows Installer CleanUp Utility
    Now launch Windows Installer CleanUp ("Start > All Programs > Windows Install Clean Up"), find any entries called "ipod for windows \[date]" or "ipod updater \[date]" or just "ipod for windows" in the list of programs in CleanUp, select those entries, and click “remove”.
    Quit out of CleanUp, and restart the PC.
    Does an itunes install go through properly after that?

  • Can not update error 1602 and can not restore error 1604 what is the solution

    Have a IPod touch 4, can't update (error 1602) and can't restore (error 1604) any solution?

    try this support article.

  • WINDOWS UPDATE ERROR, SERVICE ERROR, ETC. PLEASE HELP!!

    Problems Found:
    Some security settings are missing or have been changed. 
    Service registration is missing or corrupt
    Windows Update Error 0x80070057(2014-07-16-T-03_16_19P)
    Problems installing recent updates 
    I have literally tried everything I can and its just getting even more upsetting :(
    Im running an ASUS w/ Windows 8.1 and cannot find the solution for the following....
    It seems to me, like I have never gotten any updates that I need... only download it gives me is the windows defender update. I've tried resetting the windows update did a health scan no bad sectors. 
    PLEASE HELP!

    Problems Found:
    Some security settings are missing or have been changed. 
    Service registration is missing or corrupt
    Windows Update Error 0x80070057(2014-07-16-T-03_16_19P)
    Problems installing recent updates 
    I have literally tried everything I can and its just getting even more upsetting :(
    Im running an ASUS w/ Windows 8.1 and cannot find the solution for the following....
    It seems to me, like I have never gotten any updates that I need... only download it gives me is the windows defender update. I've tried resetting the windows update did a health scan no bad sectors. 
    PLEASE HELP!

Maybe you are looking for