Microsoft Access is slow??

I have an application that connects to an Access database. I can connect and search the database with no problems. My problem arises when I try to add a record to the database. When I run the code, there are no exceptions and the code completes successfully, but the record does not get added. IF I take the same code with no changes and step through it with the debugger in my IDE (currently Eclipse, but also works the same in other IDE's that I have) it adds the record to the database with no problem. Now this would be fine if I was the only one adding records to the database (not really, but....) but the users can't do this.
Is this a bug or an issue that is known or is this, as usual, a fluke that only affects me?
Thank you in advance for any advice / assistance you can give me.
Code is posted below..
=============================================
import java.sql.*;
* @author ssmoot
* TODO To change the template for this generated type comment go to Window -
* Preferences - Java - Code Style - Code Templates
public class AddID {
public static void AddIDs() {
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String database = "jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ=c:\\searchapp\\oldLogins.mdb";
Connection con = DriverManager.getConnection(database, "", "");
Statement stmt = con.createStatement();
     // test block
String empID = "99883";
String efnme = "Test";
String elnme = "Case3";
String effDate = "05/25/2005";
String ISO = "GP3SGS";
String acfID = "GP3FFE, GP4SDS";
String otisID = "DSOFRG, GP5RRR";
String inGenQuery = ("INSERT INTO oldLogins(EmplID, LastName, FirstName, EffDate, SecAnalyst) " +
               "Values('" + empID     +
                              "','" + elnme +
                              "','" + efnme +
                              "'," + effDate +
                              ",'" + ISO + "')");
System.out.println("Now executing the Query..");
     stmt.executeUpdate(inGenQuery);
System.out.println("Finished executing Query..");
catch (Exception e) {
e.printStackTrace();
public static void main(String[] args){
     System.out.println("--------------Invoking class-------------");
     AddIDs();
     System.out.println("---------------Ending class--------------");
}

Well, now this still isn't totally working.... When going through a series of inserts, the last insert does not work UNLESS I step through a debugger again..
Arrrggghhh!
import java.sql.*;
import java.text.*;
import java.util.Arrays;
import java.util.List;
import java.util.ListIterator;
* @author ssmoot
* TODO To change the template for this generated type comment go to Window -
* Preferences - Java - Code Style - Code Templates
    public class AddID {
       public static void AddIDs() {
           // test block
             int    thsID = 0;
         String empID = "99887";
         String efnme = "Test";
         String elnme = "Case7";
         String effDate = "05/05/2005";
         String ISO = "GP3SGS";
         String acfID = "GP3FFE, GP4SDS";
         String otisID = null;
         try {
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            String database = "jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ=Q:\\MyDBPath\\oldLogins.mdb";
            Connection con = DriverManager.getConnection(database, "", "");
            Statement stmt = con.createStatement();
            String ds = effDate;
            DateFormat df = DateFormat.getDateInstance();
            try {
               Date d = (Date) df.parse(ds);
            catch(ParseException e) {
               System.out.println("Unable to parse " + ds);
            String inGenQuery = ("INSERT INTO oldLogins(EmplID, LastName, FirstName, EffDate, SecAnalyst) " +
                               "Values('" + empID     +
                                              "','" + elnme +
                                              "','" + efnme +
                                              "'," + effDate +
                                              ",'" + ISO + "')");
            int returned = stmt.executeUpdate(inGenQuery);
            // System.out.println(returned);
              String getIDQuery = ("Select ID from oldLogins " +
                                         "WHERE EmplID = '" + empID + "'");
              ResultSet id_rs = stmt.executeQuery(getIDQuery);
              while(id_rs.next()){
                   thsID = id_rs.getInt("ID");
              String acfQuery = ("");
              String otisQuery = ("");
              if(acfID != null){
                  List al = Arrays.asList(acfID.split(",") );
                  ListIterator alit = al.listIterator();
                   String a = "";
                   while(alit.hasNext()){
                        a = (String) alit.next();
                        acfQuery = ("INSERT INTO ACF2IDs(ACF2KEY, ACF2ID) " +
                                       "VALUES("+ thsID +
                                                  ",'" + a.trim() + "')");
                        System.out.println(acfQuery);
                        returned = stmt.executeUpdate(acfQuery);
              if(otisID != null){
                   List ol = Arrays.asList(otisID.split(","));
                    ListIterator olit = ol.listIterator();
                   String o = "" ;
                    while(olit.hasNext()){
                         o = (String) olit.next();
                         otisQuery = ("INSERT INTO OTISIds(OTISKey, OTISId) " +
                                         "VALUES("+ thsID +
                                                    ",'" + o.trim() + "')");
                         System.out.println(otisQuery);
                         returned = stmt.executeUpdate(otisQuery);
                         System.out.println(returned);
             catch (Exception e) {
               e.printStackTrace();
       public static void main(String[] args){
            System.out.println("--------------Invoking class-------------");
            AddIDs();
            System.out.println("---------------Ending class--------------");

Similar Messages

  • What is the best solution for me to run Microsoft Access on my brand new iMAC?  Assume I'm a casual user.

    What is the best solution for me to run Microsoft Access on my brand new iMAC?  Assume I'm a casual user.
    I am lead to believe by some real smart guys on the Apple site that If I have the Apple Store partition my iMAC and add the full suite of Office products on that partition, I can run the few Access programs I have and need to run.
    Comments encouraged.  Thank you in advance for your consideration and help.

    You would have to install Windows, then install Microsoft Office Professional for Windows on it  To install Windows you will have to choose between Boot Camp (faster, free) and a Virtual Machine (simpler, slower, easier to backup)
    You should try LibreOffice (free), it can open Access files, it may not have all Access's feature set though, worth a try.
    www.libreoffice.org

  • Microsoft Access with Unicode

    Hi,
    I recently upgraded my website from CF5 to CF9 running on a virtual server. Below are the specs.
    CF Version: 9,0,0,251028
    Edition: Enterprise
    Operating System: Windows Server 2008
    My old code worked fine except that certain queries were running slow. My hosting provider suggested that I change the driver from "Microsoft Access" to "Microsoft Access with Unicode." As suggested, it did make things much faster. However, there were some pages on my site that didn't work. I did some research and found I had used two "reserved" words for table names that caused the pages to fail when using "Microsoft Access with Unicode" as the driver. Oddly enough, the pages worked fine with the regular "Microsoft Access" driver.
    I am now down to just one error left that I cannot resolve. I get the following error ONLY when using the "Microsoft Access with Unicode" driver.
    Error Executing Database Query.
    Query Of Queries runtime error.
    The select column reference [GetList.ItemNo] is not found in table [GetList].
    This is the code it is referring to.
    <!--- Use QofQ to join queried records against cart data --->
    <CFQUERY NAME="GetProducts" DBTYPE="query">
      SELECT
      GetList.ItemNo AS ItemNo,
      GetList.Item AS Item,
      GetList.Grades AS Grades,
      GetList.Price AS Price,
      GetList.OrderQty AS Quantity,
      (GetList.OrderQty * GetList.Price) AS ProductSubTotal
      FROM GetList
    </CFQUERY>
    Is there an issue with "Microsoft Access with Unicode" not playing nicely with Query Of Queries?
    I would greatly appreciate any help with this issue.
    Thanks,
    Steve

    THANK YOU!  THANK YOU!  THANK YOU!
    I never noticed that I had included the column "ItemNo" more than once (as you can see below). I removed the extra and it worked perfectly!
    Thanks again!
    Steve
    <cfquery name="GetList"
    DATASOURCE="#request.ds#"
    USERNAME="#request.dsuser#"
    PASSWORD="#request.dspass#">
    SELECT
    o.OrderID,
    o.OrderDate,
    o.ShipState,
    o.ShipCountry,
    o.TaxExempt,
    o.PromotionalCode,
    oi.ItemNo,
    oi.OrderQty,
    oi.Price,
    p.ItemNo,
    p.Item,
    p.Grades 
    FROM Orders o,
    OrdersItems oi,
    Products p
    WHERE o.OrderID = #ATTRIBUTES.OrderID#
    AND oi.OrderID = o.OrderID
    AND p.ItemNo = oi.ItemNo  
    </cfquery>

  • MOVING DATA FROM MICROSOFT ACCESS, EXCEL, PUBLISHER AND WORD TO AN IMAC G5

    I HAVE INHERITED AN IMAC G5 RUNNING MAC OSX. CAN I CONVERT MY MICROSOFT ACCESS, EXCEL, PUBLISHER AND WORD FILES FROM MY HP PAVILION RUNNING WINDOWS 98 SE TO RUN ON THIS IMAC?

    Please do not post in ALL CAPITAL LETTERS.
    It looks like you are SHOUTING AT EVERYONE.
    That said... you can purchase Microsoft Office for Mac and use your Word and Excel files as you normally would on any Windows PC.
    Microsoft Access and Publisher will require you to use Microsoft Windows and Microsoft Office for Windows. You'd need to install Virtual PC for Mac on your G5 to use Windows and Office for Windows.
    It'll likely be slow and painful.

  • Can not Insert data to Microsoft Access successfully

    I am using Microsoft Access database, and trying to insert some data into a table with a "while" loop, but every time, the last row can not be inserted although the return value of the "executeUpdate()" is 1, can anyone tell what's wrong with that? thank you very much

    http://forums.java.sun.com/thread.jsp?forum=48&thread=147704
    Sounds like it may be the same "glitch"
    Jamie

  • Can't view Microsoft Access data

    Hello,
    I am trying to use a Microsoft Access database (97) as a data source for my repository. I can import it in the Administration Tool and see all the tables. When I finish my repository the global consistency is without errors.
    Then I go to the Answers and make a table, here I see the repository but when I try to view the results it returns only values from the other data source.
    I am using OBIEE 10.1.3.3.2
    Anyone got a suggestion?
    Rgds,
    Dennis de Kock

    I cannot see data at column level either.
    Perhaps there still is a (logical) problem in your logical model.
    I suggest to quickly create a new business model, just for testing. Drag and drop 1 table from your access source twice to the business model. Create a complex join between table and table#. Put an aggregate on one number field in table#. Drag/drop business model to presentation layer.
    Have a look if you now have data from this table in Answers.
    Regards

  • How do I open a pdf stored in a Microsoft Access database using Visual Basic studios 2012

    Currently I am unable to find a valid method of being able to open a pdf stored in a Microsoft Access database using Visual Basic studios 2012. I've tried displaying the entire database on a form, but when I do this all the other columns show up with
    the correct data besides the one containing the pdf's, it just displays <binary data> in each row down the column. I also tried another method with which you use the database as a dataset and can drag and drop the rows and columns into the form, which
    again works for all the other columns besides the one containing the pdf's but this time I'm unable to interact with the column  at all. 
    Not too sure if this is in the correct place, but any answers or help would be appreciated. Cheers.

    Alex,
    This forum is dedicated to Project and Project Server. You might get better response, if you post to a Visual Basic forum. Here are couple I could find. 
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vbgeneral%2Cvblanguage&filter=alltypes&sort=lastpostdesc
    Cheers,
    Prasanna Adavi, Project MVP
    Blog:
      Podcast:
       Twitter:   
    LinkedIn:
      

  • The Microsoft Access database engine cannot open or write to the file in Report Builder 3.0

    I am trying to build a report in Report Builder 3.0.  I created the Data Source to point to my Excel file and the Data Set.  I drag a couple of fields on to the canvas and then choose Run.  I get the error:  "The Microsoft Access
    database engine cannot open or write to the file.  It is already opened exclusively by another user".  I am using the Excel driver.  Why am I getting this message?  How can I fix this?

    No, now I am getting the error message again.  It is quite long:
    ERROR [HY000] [Microsoft][ODBC Excel Driver] The Microsoft Access database engine cannot open or write to the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view and write its data.
    ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute Trusted_Connection
    Please help

  • How do I open a Crystal Report from Microsoft Access?

    I'm looking for step-by-step instructions on how to launch a Crystal Report from a Microsoft Access application (for a dummy like me).
    My Crystal Report uses a connection to the Access database as the data.
    I have Microsoft Access 2002 with Microsoft Visual Basic 6.5.
    I have Crystal Reports 2008 CR Developer 12.
    I'll need to know where to find the Visual Basic code references, and/or ActiveX Controls, if applicable.
    Thanks
    Janeen

    I concur with Don. Just a bit of help - a sample VBA app is here;
    https://smpdl.sap-ag.de/~sapidp/012002523100006013432008E/rdc_vba.exe
    But as Don mentioned, you will have to downgrade to CR XI r2 (or lower) to implement the above solution.
    Ludek

  • Insert into Microsoft access 2010 Database on sharepoint using OLEDB

    Hi,
    want to insert data into a microsoft access web db using oledb object. but the i am unable to open the database.
        dbLoc = "http://XXXX.com/project/design/Test_Web_DB
        Dim strConnection As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source= " & dbLoc
        Try
                con = New OleDb.OleDbConnection(strConnection)
                If con.State = ConnectionState.Closed Then con.Open()
        Catch ex As OleDbException
               MsgBox("OleDbException: Unable to Open DB")
        End Try
    it always go to the exception. is there any problem with the above code??

    Hey Bala,
    Browsing the link (as shown below) on the browser doesnt open the DB.
    http://XXXX.com/project/design/Test_Web_DB.accdb
    Instead, without ".accdb" works.
    my requirement is something like below, please recommend your suggestion
    1. i have a DB on access 2010, which gets updated on regular basis (currently db is on common location) by different VB.net application client my the network
    2. i want to create various reports out of the data and want them visible available on sharepoint.
    please help
    -Manash

  • How can I use Microsoft Access on my Mac? Boot camp?

    How can I use Microsoft Access on my Mac? Boot camp?

    Running Windows or using a suite such as Libre Office. It is similar to Office 2007 for Windows, but runs on a Mac, and contains a database manage that is Access compatible.

  • How can I use Microsoft Access on my Mac?

    How can I use Microsoft Access on my Mac Pro?

    Welcome to Apple Support Communities
    Microsoft Access isn't available for OS X, so you can't use it. If you need it, you have to install Windows on a virtual machine.
    On a virtual machine, you can install the Windows version you most like and the Access version you need, so you won't have any problem using it. You just need a full Windows version with its DVD or ISO image and product key, and an application like Parallels, VMware Fusion or VirtualBox to create the virtual machine. If you want to save money, System Builder versions are cheaper and you can find them at Amazon or NewEgg.
    As you have a Mac Pro, I suppose you won't have any problem using a 64-bit version, but it's important you have enough memory. Open  > About this Mac, and check how much memory you have. I recommend 4 or 8 GB of memory at least.
    After installing Windows on the virtual machine, you will be able to install Access there.
    There are applications for OS X that allow you to run Windows applications without having to install Windows. Those apps often fail, so I don't recommend you to use them

  • HT6114 My Mac Book Pro had a split drive with Windows Microsoft Access on it and it was removed when Mavericks installed.  I need this so how can I go back to the old system?

    My Mac Book Pro had a split drive with Windows Microsoft Access on it and it was removed when Mavericks installed.  I need this so how can I go back to the old system?

    Restore from the backup you had prior to installing Mavericks.
    However, the upgrade should not have altered your partition scheme. Did your erase and format the drive prior to upgrading?

  • How do I get mail on my iPhone and computer to sync automatically, so e.g. messages read on one appear read on both?  I am working in VN and the microsoft access server is in the USA.

    How do I get mail on my iPhone and computer to sync automatically, so e.g. messages read on one appear read on both?  I am working in VN and the microsoft access server is in the USA.

    If you created as an Exchange account on the iPhone (not IMAP or POP) and you have Push on it should all work smoothly; Reading a message on either client should mark the other read (it does on mine). Try deleting the account from the phone, rebooting the phone (to clear out old settings), then go to Settings/Mail,Contacts,Calendar, add an account and tap Microsoft Exchange and add the account back.
    There is a fundamental difference between BB and iPhone that you should be aware of; on the BB you do not sync directly with Exchange; you sync with the RIM server which then syncs with your Exchange server. The iPhone syncs directly with Exchange using Microsoft's ActiveSync protocol. So in some ways they will behave differently. But ActiveSync should manage marking messages as read correctly.

  • Is it possible to Install the 64-bit Microsoft Access Database Engine 2010 if we are running Microsoft Office 2010 32-bit?

    So we are running Microsoft Office Professional Plus 2010, Version 14.0.7015.1000
    (32-bit)
    This is what is installed via our Network and Network licensing.
    I am trying, in vain, to read and write a .xlsx file via a C# Edit Script in a SSIS Package. And I have tried using...
    string StringConnection = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + sourceFile + ";Extended Properties=\"Excel 12.0;HDR=Yes;IMEX=1\"";
    And this tells me that this has not been installed. So when I go and try and get the Microsoft Access Database Engine 2010 64-bit, which would allow me to use Microsoft.ACE.OLEDB.12.0 and allow me to read, write, and process this .xlsx file, it tells me
    I cannot install it because I already have 32-bit installed and it wants me to un-install Microsoft Office 2010. Why? Because it is 32-bit? And I can't do that because this is what we have and what we're licensed for and from what I've read seems to be the
    industry standard because most software vendors are ill equipped to process 64-bit right now.
    So my question is this...How can I use a C# Edit Script to read and process a .xlsx file? Because if I try using...
    string StringConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + sourceFile + ";Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=1\"";
    It then tells me that the file is not in that format.
    Please excuse me for asking this question in a couple of different ways out here but I cannot for the life of me seem to be able to get an answer as to how I can process a .xlsx file with a C# script and which driver to use that will make this work.
    Thanks for your review and am hopeful for a reply.
    ITBobbyP85

    Hi ITBobby85,
    If the excel version in the Connection Manager is Microsoft Excel 2010 (.xlsx), we should use Microsoft.ACE.OLEDB provider.
    We can't install 32bit and 64bit parts of office on the same machine. We will get an error as you said when we run the installer to install the 64bit version of the Microsoft Access Database Engine 2010 Redistributable in the machine where a 32bit version
    of Microsoft Office installed. To fix this issue, please download and install the 32bit version of the Microsoft Access Database Engine 2010 Redistributable with the link below:
    http://www.microsoft.com/en-us/download/details.aspx?id=13255
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

Maybe you are looking for