Inserting issue with MS Access

Hi,
I am trying to insert a record in MS Access. Following is the code.
class SqlTest {
public static void main(String args[]) throws Exception {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:myDsn");
Statement stmt = con.createStatement();
stmt.executeUpdate("insert into emp values('e999', 'Raj')");
After executing the program, if I check the data base the record would not have been inserted. The program does not even throw any exception. If I execute the same program with ORACLE, it works fne and record gets inserted. Could some one please let me know what could be the problem?

Hey guys,
I also tried executing the query directly in MS Access and it just worked fine.
Also I got work around for my problem. If I extract data after I insert it in the same program, then the record gets inserted. May be it has got do with COMMIT operation. But what if I have to do only INSERT operation without selecting data?

Similar Messages

  • Issue with assistive access not keeping permissions

    Since a recent upgrade (likely from OS X 10.9.x to 10.10.2) I've had issues with Assistive Access blocking Automator and Applescript from interaction with dialogs.
    If I run my script or my Automator workflow (which basically has the same script in it) I get the error:
    System Events got an error: Automator is not allowed assistive access. (in the case of Automator).
    If I open Automator, and then untick and retick the Automator entry in the Accessibility options within Security & Privacy (System Preferences), then workflow can run again. It continues to work until I Quit Automator. Then it's as if OS X no longer trusts Automator to be the same app I gave Accessibility permissions to.  And the situation repeats. It's much as if it were not code-signed. The exact same issue plays out with Apple Script.
    I came across this info, which I hoped would solve the problem, but it made no difference: http://macscripter.net/viewtopic.php?id=43394 and http://bit.ly/1x3SRmc
    In my Accessibility permissions I now have:
    Script Editor
    Automator
    1Password 5 (which the script interacts with)
    com.apple.security.agentStub.xpc (in case that's being called up and triggering the Accessibility issue)
    osascript (in case that's handling the script and triggering the Accessibility issue)
    SecurityAgent.xpc (in case that was triggering the Accessibility issue)
    I added all these because the post at http://bit.ly/1x3SRmc     indicated that anything Apple Script is interacting with needs Accessibility access permissions.
    My script is as follows:
    set appName to "SecurityAgent"
    set passApp to "1Password 5" (* set this to the name of your password manager *)
    tell application "System Events"
      if not (exists window 1 of process appName) then -- test if SecurityAgent window exists
      set answer to display dialog "The password dialog was not found. Please check." buttons {"Ok"}
      return -- abort if SecurityAgent window does not exist
      end if
    end tell
    tell application "System Events"
      set position of window 1 of process appName to {10, 10}
    -- move SecurityAgent window out of the way
    end tell
    activate application passApp
    tell application "System Events"
      tell application "SystemUIServer"
      set answer to display dialog "Make sure correct 1Password item is actively selected (i.e. click it again if it was previously selected), then click “Continue” to proceed." buttons {"Continue"}
      end tell
      tell process passApp
      (* If you are not using 1Password, you may need to change the menu item clicks, below, to whatever is correct in your particular password manager *)
      click menu item "copy password" of menu "item" of menu bar 1
      delay 1
      set appData to the clipboard
      end tell
      tell application "System Events"
      tell process appName
      set value of text field 1 of window 1 to appData
      if exists (text field 2 of window 1) then
      set value of text field 2 of window 1 to appData
      if exists checkbox 1 of window 1 then
      if value of checkbox 1 of window 1 is 1 then
      click checkbox 1 of window 1
      end if
      end if
      set value of checkbox 1 of window 1 to 0
      delay 1 (* gives  a moment to see what's going on *)
      click button "OK" of window 1
      else
      if value of checkbox 1 of window 1 is 1 then
      click checkbox 1 of window 1
      end if
      delay 1 (* gives  a moment to see what's going on *)
      click button "OK" of window 1
      end if
      end tell
      end tell
    end tell
    In Automator it would appear the script is generating an error as soon as it reaches line 5, "if not (exists window 1 of process appName) then"
    I would greatly appreciate some assistance in resolving this issue.

    Starting with Mavericks, Apple changed the way that the accessibility works (see Using AppleScript with Accessibility and Security features in Mavericks) - each individual application needs to be given access, instead of a global option.  A regular AppleScript application saves properties and global variables with the script, which makes it a new application as far as the system security is concerned, so it needs to be re-added to the accessibility list.  To work with this new security feature, you need to code-sign your AppleScript application or make the script(s) in the bundle read-only so that they don't get changed (note that an AppleScript-based project in Xcode does not modify the application bundle by saving properties and globals).

  • Insert issue with connection to MS Access

    Hi
    New to Java and this forum, if I'm in the wrong forum for this question please direct me to the correct one, thanks.
    I'm able to connect and query my table no problem but when I try to insert a record with a date field it fails. I've spent the last two days googling the internet and trying every example I can find but I cannot get this to work. Here's where I left off, assume I've made my connection to the database.
    public void insertRecord()
    java.sql.Date dt = java.sql.Date.valueOf("1998-12-25");
    String sql = "INSERT INTO table1 ( name, date ) " +
    "VALUES ( ?, " + dt + " )";
    try
    PreparedStatement ps = connection.prepareStatement(sql);
    ps.setString(1, "Linn");
    ps.executeUpdate();
    catch ( Exception e )
    System.err.println( "Failed to insert record." );
    } // end method insertRecord
    Can someone show me where I'm going wrong here? Or can someone provide me with a simple example that actually works?
    My Access table has three fields:
    id <autonumber>
    name <text(50)>
    date <date/time custom format yyyy,mm,dd>
    Thanks in advance,
    Linn

    More specific
    String sql = "INSERT INTO table1 ( name, date ) " +
    "VALUES ( ?, #" + dt + " #)";Hi,
    Thanks for the response, I tried your suggestion but
    it still doesn't work for me.
    Anything else I can try?
    Thanks much,
    LinnAh, got it! I remembered seeing a posting elsewhere that suggested putting square brackets around the field name "date", like this [date]. I don't recall why they said this was necessary though. Tried that and it looks like it's working. To complete this for anyone else who finds this thread here's the final insert command.
    String sql = "INSERT INTO table1 ( name, [date] ) " +
    "VALUES ( ?, #" + dt + "#)";
    This worked for me.
    Thanks again,
    Linn

  • Issue with web access in view administrator console after connection server 5.5 installation.

    Hi All,
    I am  trying to bring up my setup with ESXi 5.5 and vcenter 5.5 U2. I made a DNS server and made two 2008 R2 machines and launched vcentre and connection manager on them.
    After installing connection server 5.5, I am unable to open the web UI by clicking "view administrator console" icon on my desktop! I installed proper certificated and iis module too and confirmed that my https certificate is properly working. (snapshot attached, filename - snapshot_view_webpage.jpeg)
    I google for the possible error and tried below mentioned links but none of them worked.
    1.)    http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2004759
    Corrected this error but still system is in same shape and i am unable to get the console's admin webpage.
    2.)    http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2001277
    In this method, my admin folder  didn't got recreated as the service restart got stuck for a long time and throws error that service restart got time out!!(snapshot attached)
    Can some one please help me to move forward. Please let me know if you need more information from my end.
    Thanks,
    Jeevan

    Since the policy AKS is top in sequence under service selection rule so it should hit for sure. As you wrote that even after disabling the default device admin, then also request is hitting the same and restarting the ACS services resolved the issue. The symptoms of your issue are exactly same as stated in this defect.
    CSCuo93378    Certain browsers cause ACS database corruption
    Due to this issue we have seen cases where request hits the disable and default policies without any reason. Actually accessing ACS via chrome mess around with all the operators in conditions.
    The only workaround is to access all the rules and conditions in supported browser. Ensure all the operators are correct, save the changes and restart the ACS services.
    The issue seems to be fixed in ACS 5.5 patch 5
    Regards,
    Jatin

  • Bulk Insert Issue with BCP

    I'm running SQL Server 2008 R2 and trying to test out bcp in one of our databases. For almost all the tables, the bcp and bulk insert work fine using similar commands below.  However on a few tables I am experiencing an issue when trying to Bulk Insert
    in.
    Here are the details:
    This is the bcp command to export out the data (via simple batch file):
     1.)
    SET OUTPUT=K:\BCP_FIN_Test
    SET ERRORLOG=C:\Temp\BCP_Error_Log
    SET TIMINGS=C:\Temp\BCP_Timings
    bcp "SELECT * FROM FS84RPT.dbo.PS_PO_LINE Inner Join FS84RPT.[dbo].[PS_RECV_LN_ACCTG] on PS_PO_LINE.BUSINESS_UNIT = PS_RECV_LN_ACCTG.BUSINESS_UNIT_PO and PS_PO_LINE.PO_ID= PS_RECV_LN_ACCTG.PO_ID and PS_PO_LINE.LINE_NBR= PS_RECV_LN_ACCTG.LINE_NBR WHERE
    PS_RECV_LN_ACCTG.FISCAL_YEAR = '2014' and PS_RECV_LN_ACCTG.ACCOUNTING_PERIOD BETWEEN '9' AND '11' " queryout %OUTPUT%\PS_PO_LINE.txt -e %ERRORLOG%\PS_PO_LINE.err -o %TIMINGS%\PS_PO_LINE.txt -T -N
     2.)
    BULK INSERT PS_PO_LINE FROM 'K:\BCP_FIN_Test\PS_PO_LINE.txt' WITH (DATAFILETYPE = 'widenative')
    Msg 4869, Level 16, State 1, Line 1
    The bulk load failed. Unexpected NULL value in data file row 2, column 22. The destination column (CNTRCT_RATE_MULT) is defined as NOT NULL.
    Msg 4866, Level 16, State 4, Line 1
    The bulk load failed. The column is too long in the data file for row 3, column 22. Verify that the field terminator and row terminator are specified correctly.
    Msg 7399, Level 16, State 1, Line 1
    The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.
    Msg 7330, Level 16, State 2, Line 1
    Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".
    I've tried a few different things including trying to export as character and import as BULK INSERT PS_PO_LINE FROM 'K:\BCP_FIN_Test\PS_PO_LINE.txt' WITH (DATAFILETYPE = 'char')
    But no luck
    Appreciate help

    It seems that the target table does not match your expectations.
    Since I don't know exactly what you are doing, I will have to resort to guesses.
    I note that you export query goes:
      SELECT * FROM FS84RPT.dbo.PS_PO_LINE Inner Join
    And then you are importing into a table called PS_PO_LINE as well. But for your operation to make sense the import PS_PO_LINE must not only have the columns from the PS_PO_LINE, but also all columns from PS_RECV_LN_ACCTG. Maybe your SELECT should read
      SELECT PS_PO_LINE.* FROM FS84RPT.dbo.PS_PO_LINE Inner Join
    or use an EXISTS clause to add the filter of PS_RECV_LN_ACCTG table. (Assuming that it appears in the query for filtering only.)
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Issue with Teradata access from Business Objects AIX Machine

    Hi,
    I am using BO  XI.31 which is installed on AIX 5.3 machine. I have installed Teradata driver on the machine and I have created the require ODBC.ini entry to point Teradata database. While refreshing the report I am getting below error message.
    A database error occured .The database error test is (CS) "DBDriver failed ot load: /BOBJ/xi_3.1...Connectionserver/libdbd_tdodbc.so
    0509-022 Cannot load module/BOBJ/xi_3.1....ConnectionServer/libdbd_tdodbc.so
    0509-150 Dependent module libodbc.a(odbc.so) Could not be loaded.
    0509-022 Cannot load module libodbc.a(odbc.so)
    0509-022 System error:A file or directory in the path name does not exist.
    Any body know what are the steps require to access teradata database from AIX box

    Hi Jacks,
    Following information might help you to resolve the issue.
    This is caused by a wrong HOME environment variable of the user that starts the BO processes.
    Resolution
    Check the correct path of your BO 3.1 installation and export it as HOME environment variable:
    Example:
    BO 3.1 installation path: /home/<bouser>/bo3.1/Enterprise12.0../...
    Type in the command line:
    export HOME=/home/<bouser>/boversion
    You can also change this environment variable permanently if you edit the .profile file of the BO user (home/<username>/.profile), adding the above line into the file, then source it again with:
    . .profile
    or with a logoff/logon of the session.
    Check if the path of your HOME is correct with:
    env | grep HOME
    Now you can run the installation setup without any error.
    Regards,
    Sarbhjeet Kaur

  • Issue with changing Access Service in ACS 5.2

    Hi,
    I am working on lab setup where I installed ACS 5.2 I created new access service and used it in existing service selection rule (Rule-2) earlier but it didn't work. Later I created new service selection rule and applied new service access rule. However even after this change it keeps applying predefined default access access service. Please refer attached picture for better understanding.
    As shown, I want Aks-Rule to work and apply service 'Lab-Policy' however it keeps referring Rule-2 and applies 'Default Device Admin' access service even after I disable it. 
    I have to restart ACS service from CLI console to make it work. Is this a bug or am I missing anything. Please advise guys.
    Regards,
    Akshay

    Since the policy AKS is top in sequence under service selection rule so it should hit for sure. As you wrote that even after disabling the default device admin, then also request is hitting the same and restarting the ACS services resolved the issue. The symptoms of your issue are exactly same as stated in this defect.
    CSCuo93378    Certain browsers cause ACS database corruption
    Due to this issue we have seen cases where request hits the disable and default policies without any reason. Actually accessing ACS via chrome mess around with all the operators in conditions.
    The only workaround is to access all the rules and conditions in supported browser. Ensure all the operators are correct, save the changes and restart the ACS services.
    The issue seems to be fixed in ACS 5.5 patch 5
    Regards,
    Jatin

  • Issue with Data Access Profile

    Hi Experts,
         Facing issue while using Data Access Profiles:
    I have created a data access profile ,giving access to only limited members for  a particular model.
    While logging in using a particular user id which is assigned to this data access profile I am able to see all the members for which the access is denied
    and I am also able to manipulate the transaction data. But in data access profile I have provided only read access.
    Recently,the system has been upgraded with a new support package after which we are facing the issue.
    Please help us solving the issue.
    BPC version:  10.0 NW
    SP : 15
    Best Regards,
    Remya

    Dear Ramya,
    Again do the setting for data access profile.  Sometime it will not refresh.
    Regards,
    Nanny

  • BAPI_GOODSMVT_CREATE lock issue with no access to ABAP!

    Hello everyone,
    I have written a class in vb .NET that uses the BAPI_GOODSMVT_CREATE to post goods issues. I have done numerous tests myself which all were successful. However, when a colleague wanted to test my class he suddenly got the following error "The plant data of the material <XXXX> is locked by the user <XXXX>". The user specified is the standard background user we use for RFCs. So basically the user is blocking himself.
    This issue seems to be quite common as Google turns up with numerous results. They either end up with people being desperate and giving up or finding solutions in ABAP. However, my team has no access to ABAP since SAP-programming has all been outsourced to India. Getting any changes done in ABAP will be a long and tedious progress for which we simply do not have the time.
    Is there anyway to resolve this issue on our side? Maybe through other RFCs or changes in how we handle the BAPI? I am quite desperate as this problem occurred shortly before we wanted to go live and now it is not sure we can even do anything on our side.

    Hi Tom,
    If you want to call DEQUEUE_ALL from vb.net then tell your ABAP counterpart to create a new remote enabled function module and he can subsequently make a call to DEQUEUE_ALL in the custom developed function module through ABAP. You can then call the newly created custom function module using its calling parameter.
    Also, if required he can expose that newly custom created function module as a webservice that you can call from vb.net.
    I hope its clear to you now about how can you access it from vb.net.
    Regards,
    Sachin

  • SQL Issue with MS Access

    Hello;
    I have an SQL query:
    Select year, sum(group1) as A from table1 where name in ('test1', 'test2') group by year;
    When I run it through SQL editor in MS Access it returns the years and sum and a total of 5 rows.
    When I pass this command through Java: Connection.createStatement and executeQuery
    I can print the values and it prints 5 rows but after printing it hangs.
    When i get the size of result set :
    while(rs.next())
    resultSetSize ++;
    System.out.println(rs.getInt(1) + "\t" +resultSetSize);
    It shows the result set as size of 10, when i print the values it stops at 5. I am not sure where the issue is.
    I think since my where condition is have 2 values it might be causing problem.
    If I just put 1 value after my where condition, then the java code runs fine.
    Can anyone tell me what the issue is here or where am I going wrong?
    Thanks for your help.
    Edited by: yesmein on Apr 23, 2009 5:58 AM

    Thanks for the suggestion. I checked the code. Indeed I was not printing an exception. When I printed the exception this is what i get:
    Exception is: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state
    hope this helps to guide me on how to solve this issue.
    Below is the code:
    public static void TestQuery()
    String query="SELECT year, sum(group1) as A FROM table1 WHERE name in ('test1', 'test2') ";
    Connection conn = ConnectDB1.getDBConnection(); //this gets the database parameters from a properties file
    Statement stat = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    ResultSet rs = stat.executeQuery(query);
    int resultSetSize=0;
    while(rs.next())
    resultSetSize ++;
    System.out.println(rs.getInt(1) + "\t" +resultSetSize);
    rs.beforeFirst();
    System.out.println("Size of result set: " +resultSetSize);
    while(rs.next())
    System.out.println(rs.getInt(1) + "\t" + rs.getInt(2) );
    rs.close();
    stat.close();
    conn.close();
    System.out.println("End of program");
    catch (Exception e){System.out.println("Exception is: " +e);}
    }

  • HT4623 IOS 7 issues with FaceTime access

    Just updated my IPad with IOS 7 and can't access FaceTime can anyone help me please ?

    I have found that people with this problem have been able to get it worked out after a restore.
    http://support.apple.com/kb/HT1414

  • Issue with Excel Access Web Part, with sites that were migrated from 2010 SP to 2013 SP

    Hello, 
    If I try to add an Excel Access Web Part to a page I get the following:
    **Note: This only happens with sites that were migrated from 2010 SharePoint to SharePoint 2013. If I create a new site the feature works like it should and loads the workbook. I've tested this on several sites, our environment is enterprise as well. Being
    that the majority of our sites were migrated from 2010, I need this to work! 

    Can you try below fix and let me know
    http://blogs.technet.com/b/excel_services__powerpivot_for_sharepoint_support_blog/archive/2013/05/21/excel-services-the-workbook-cannot-be-opened.aspx

  • Issue with the Access Sequence related to Pricing

    Hi Gurus,
    I have one issue related to Pricing. I have an access sequence ZPCD which has Table "A558" assigned to it.
    Table A558 has fields
      5  Sales Org
    10  Distribution channel
    20  Division
    25  Customer.
    But the issue is here.....in the access sequence ZPCD the field "20  Division" got deleted some how.
    but i checked the table A558, it has "Division" in it.
    So, summary is Table A558 has field Division, but the access sequence ZPCD is missing field Division in Access table A558.
    Table 518 contains 585 condition record entries entries in Production system.
    So question is how will i add Division back to the Access sequence Table A558.
    Waiting for your expert advise and comments
    Thank you

    Dear Anitha
    If I am correct, in access sequence, at field level, there is no deletion option available and hence, I am surprised how this could be possible.
    Anyway, you can try in development server as follows:-
    Go to V/07, select ZPCD, block the table 558 and delete.  Save the data.  Now try to reassign the same table and see how it works.
    thanks
    G. Lakshmipathi

  • Document management Issues with Alternate Access Mapping

    hi,
      I am using share-point 2010,I have done the AAM as follows:
     Internal URL                                        
    Zone                         
    Public URL for Zone
     http://109.XX.XX.XX:101                      Default                       
    http://abc.xyz.in
     http://abc.xyz.in                                  Default                         
    http://abc.xyz.in
    http://MyMachineName:101                 Default                          
    http://abc.xyz.in
     http://109.XX.XX.XX:201                   Intranet                          
    http://mn.abcsystems.com:201
    http://mn.abcsystems.com:201          Intranet                          http://mn.abcsystems.com:201
    http://mn.abcsystems.com:101          Internet                          http://mn.abcsystems.com:101 
     The http://mn.abcsystems.com:201 is extended site for reporting working properly.  The site http://mn.abcsystems.com:101 works properly,But When I access site using URL  http://abc.xyz.in facing following issues:
     1.Default windows of share point list for adding,editing updating data not working properly...
    2.filters for share-point list not populating.
    3.In document Management, unable to delete & open the added document...

    We have only 1 webaap that is running on specific port (consider 101)-Claim based auth
    For reporting purpose we have extended our webapp on port 201 (windows auth)and  this extended site on intranet zone.
    For our server we have register one domain like http://mn.abcsystems.com.So it is like our server public ip address.For the same server,we have got multiple subdomain like
    http://abc.xyz.in.
    So we want to access our webapp by using http://abc.xyz.in. subdomain
    So that why we have did
     http://109.XX.XX.XX:101                   Default                       
    http://abc.xyz.in(Subdoamin url)
     http://abc.xyz.in                         Default                         
    http://abc.xyz.in
    http://MyMachineName:101                 Default                          
    http://abc.xyz.in
     http://109.XX.XX.XX:201                   Intranet                          
    http://mn.abcsystems.com:201
    http://mn.abcsystems.com:201          Intranet                          http://mn.abcsystems.com:201(extended
    for Reporting purpose)
    http://mn.abcsystems.com:101          Internet                          http://mn.abcsystems.com:101
    For subdomain url (http://abc.xyz.in) or http://109.XX.XX.XX:101 its not working for above mentioned functionality
    For domain url (http://mn.abcsystems.com:101) it work.

  • Issue with users accessing video card and /dev/nvram

    Hello,
    I have Lenovo x60s and i can't access with normal user (group users) the file
    /dev/nvram
    ever I restart de computer have execute "chmod 777 /dev/nvram" for fallowing access for users
    and with users i can't use video i810 alone use vesa
    with root i can use driver i810 on xorg, why??
    I don't understand?!?!?!

    The problem with my video is with root i can play games 3D, with users i can't, my config video card on xorg:
    Section "Device"
    ### Available Driver options are:-
    ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
    ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
    ### [arg]: arg optional
    #Option "ShadowFB" # [<bool>]
    #Option "DefaultRefresh" # [<bool>]
    #Option "ModeSetClearScreen" # [<bool>]
    Identifier "Card0"
    Driver "vesa" ---->> Now I write "VESA", while I write i810 i can't execute "startx" with normal user
    VendorName "Intel Corporation"
    BoardName "Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller"
    BusID "PCI:0:2:0"
    EndSection
    the /dev/nvram is device when i use especial keys of keyboard on my notebook,
    ever restart my pc the permissions change, I have execute "chmod 777 /dev/nvram" else i can't use with normal user.
    i think the udev always create this device on start and always create with the permission alone read and write for root, but I just find that the group is kmen and I add my user in the group.
    I restart system and verify the result.

Maybe you are looking for