"java ODBC Microsoft Access Driver Syntax error (missing operator) in query

Hi I am new to java and I am getting this error message when using java to access and insert data into an MS Access database.
"java ODBC Microsoft Access Driver Syntax error (missing operator) in query expression"
The commands are
String insertCommand = "INSERT into MetricOutput(A1,A,DRR,DeRR,RE,WDRR,WDeRR,WRE,ARF,SRF,HRF,WARF,WSRF,WHRF,SDC,WSDC,MAR,WMAR,H1,H11,H2,H21,cluster) "+
                         "VALUES("+comMappedCount+","+stdCount+","+DRR+","+DeRR+","+RE+","+WDRR+","+WDeRR+","+WRE+","+ARF+","+SRF+","+HRF+","+WARF+","+WSRF+","+WHRF+","+SDC+","+WSDC+","+MAR+","+WMAR+","+H1+","+H11+","+H2+","+H21+",+array)";

"VALUES("+comMappedCount+","+stdCount+","+DRR+","+DeRR+","+RE+","+WDRR+","+WDeRR+","+WRE+","+ARF+","+SRF+","+HRF+","+WARF+","+WSRF+","+WHRF+","+SDC+","+WSDC+","+MAR+","+WMAR+","+H1+","+H11+","+H2+","+H21+",+array)";After looking at your post in the editor, I see what your real query looks like.  You realize that ",+array[i])" is part of the query, right?  And not actually looking at your Java array?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • [ODBC Microsoft Access Driver] Syntax error (missing operator)

    Aello' - as you can see in my database table their are two
    records to delete based on the HISTORY_ID of 1. This was working
    just fine when I was using a MS SQL Server database but when I
    switched to the MS Access database I get this error now.
    Is their a syntax difference?

    mikeap wrote:
    > Attached code. Clearly their are records to delete, what
    am I missing?
    >
    > Using MS Access database.
    >
    > [Macromedia][SequeLink JDBC Driver][ODBC
    Socket][Microsoft][ODBC Microsoft
    > Access Driver] Syntax error (missing operator) in query
    expression
    > 'R_PROJECT_MEDIA WHERE Media_ID IN (1)'.
    >
    > <cfquery datasource="tbar">
    > DELETE R_HISTORY_MEDIA
    > WHERE History_ID IN (#FORM.pHistory#)
    > </cfquery>
    DELETE
    FROM R_HISTORY_MEDIA
    WHERE History_ID IN (#FORM.pHistory#)
    Jochem
    Jochem van Dieten
    Adobe Community Expert for ColdFusion

  • [Microsoft][ODBC Microsoft Access Driver] Syntax error

    I am new to Java. I have tried to write a simple program insert table in Access2002. However, I got the following error,
    ERROR: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement
    My code is as follows,
    import java.lang.*;
    import java.sql.*;
    import java.util.*;
    import java.text.*;
    public class dateconv3 {
    public static void main (String[] args) {
    //Setting up the JDBC-ODBC bridge connection
    String DRIVER_NAME = "sun.jdbc.odbc.JdbcOdbcDriver";
    String CONNECTION_URL = "jdbc:odbc:book1";
    // The JDBC Connection Object
    Connection con = null;
    // The JDBC PreparedStatement object
    PreparedStatement ps = null;
    boolean rc = false;
    try { // try under for loop
    // Get an connection
    Class.forName(DRIVER_NAME).newInstance();
    con = DriverManager.getConnection(CONNECTION_URL);
    SimpleDateFormat formatter = new SimpleDateFormat ("yyyy/mm/dd");
    java.util.Date currentTime_1 = new java.util.Date();
    String dateString = formatter.format(currentTime_1);
    ParsePosition pos = new ParsePosition(0);
    java.util.Date currentTime_2 = formatter.parse(dateString, pos);
    java.sql.Date dCurDate=new java.sql.Date(currentTime_2.getTime());
    System.out.println(dCurDate);
    String userid = "1";
    String booktitle = "Java Servlet Programming";
    int amount = 202;
    String sqltxt="INSERT INTO TRANSLOG ( userid, booktitle, date, amount ) VALUES (?,?,?,?)";
    // Create a statement object that we can execute queries with
    ps = con.prepareStatement(sqltxt);
    ps.setString(1, userid);
    ps.setString(2, booktitle);
    System.out.println(currentTime_2);
    java.sql.Date sqlDate = new java.sql.Date(currentTime_2.getTime());
    System.out.println(sqlDate);
    ps.setDate(3, sqlDate);
    ps.setInt(4, amount);
    System.out.println("INSERT into translog table");
    // Execute the statement
    ps.execute();
    rc = true;
    } catch (Exception ex) {
    // Sent the error
    System.out.println("ex.getMessage() print: " + ex.getMessage());
    } finally {
    try {
    if (ps != null) {
    ps.close();
    if (con != null) {
    // Put the connection back into the pool
    con.close();
    } catch (Exception ex) {
    // Ignore any error here
    The Access has been set to the date format yyyy/mm/dd and I got the following result.
    java dateconv3
    2001-01-04
    Thu Jan 04 00:56:00 CST 2001
    2001-01-04
    INSERT into translog table
    ex.getMessage() print: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement
    Please advise. I got frustrated with such a silly question. Anybody can help me to resolve it.
    Patrick

    INSERT INTO TRANSLOG ( userid, booktitle, date, amount ) VALUES (?,?,?,?)I don't have Access on my computer at home here, but it is quite possible that "date" is a reserved word in Access's version of SQL. If you can change the column name, I'd recommend you do that. Otherwise try changing your SQL code to this:
    INSERT INTO TRANSLOG ( userid, booktitle, [date], amount ) VALUES (?,?,?,?)
    But be warned that this [trick] doesn't work with other databases.

  • [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.

    Hi,
    I am getting following error message ,
    [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
    When run this code.
    <%@ page import= "java.sql.*"%>
    <%
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:bspipdb");
    Statement st = con.createStatement();
    st.executeUpdate("update tscipshift set 11-Aug-08='M' where TechN='Elamparuthi'");
    %>
    tscipshift=table ,column=11-Aug-08 are all exist.
    I dont know why I am getting error mesage.
    Any idea why?

    Shahbaz2008 wrote:
    you haven't set your user name and password hereI don't believe that's necessary with Access. Then again, it's not an enterprise database.
    Connection con = DriverManager.getConnection("jdbc:odbc:bspipdb");
    change it to this
    Connection con = DriverManager.getConnection("jdbc:odbc:bspipdb","+username+","+password+");
    here pass your username and password...
    In Oracle default user name and password is
    username = scott
    password = tigerSo who uses that? Only an eejit would leave that account open.
    So the statement would be
    Connection con = DriverManager.getConnection("jdbc:odbc:bspipdb","scott","tiger");
    or In Mirosoft Access there is no user name and password so the statement will be Like I said - unnecessary, and not the reason the OP is having problems.
    Connection con = DriverManager.getConnection("jdbc:odbc:bspipdb","","");>
    Besides this change your table name 11-Aug-08 to anything that is not start with number or any special symbols.
    for example aug112008 is good or aug is too good.No, it's still not good if you understand ANYTHING about relational databases and normalization.
    I think it would work.I think you're just as stup!d as the OP.
    %

  • "[Microsoft][ODBC Microsoft Access Driver] Syntax error in field definition

    I am creating a program in Java which has a Database reference application.The Database I am using is MS Access.But whenever I am trying to run the program from DOS Prompt(ie executing the program:java <program name>) I am unable to connenct to the database.The compiling of the program doesn't show any error(ie javac <program name>) The following error is displayed at the DOS Prompt:
    "[Microsoft][ODBC Microsoft Access Driver] Syntax error in field definition."
    Pls give me a detailed help report.If it is a Machine side problem do help me to solve it.Mine is a Compaq Presario Machine,OS:Windows 98,Database:MS Access(Office XP)
    I request you to help me in this matter.Pls email ur responses to:
    [email protected]
    [email protected]

    hi there
    did u configure ur ODBC setting if no then try these steps
    ================== ODBC Settings ========================
    step 1 : go to control panel
    step 2 : ODBC Data Sources
    step 3 : click UserDSN Tab
    step 4 : click ADD Button , Select Microsoft Access Driver , Finish
    step 5 : Give Datasource Name as "DATABASE_NAMEXXX" , no double quotes
    step 6 : use Select and select Database_NAME.mdb from <INSTALL DIRECTORY>\DATABASE_NAME.mdb
    click ok , ok finish
    <INSTALL DIRECTORY> is where yr database is
    =========================================================
    then in yr program
    URL for yr database
    "jdbc:odbc:DATABASE_NAMEXXX" // as name in step 5
    and Driver is
    "sun.jdbc.odbc.JdbcOdbcDriver"
    if u done all these steps then check yr spelling of table and tabel field in yr program
    hope this works for u
    regards
    Satinderjit

  • Syntax error (missing operator) in query expression works in sql

    Hi guys,
    I am having a problem with this query in Access 2007, it runs
    fine in MSSQL.
    I get this error when I run it.
    [Macromedia][SequeLink JDBC Driver][ODBC
    Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error
    (missing operator) in query expression
    'tbl_skuoption_rel.optn_rel_Option_ID = tbl_skuoptions.option_ID
    INNER JOIN tbl_skus ON tbl_skuoption_rel.optn_rel_SKU_ID =
    tbl_skus.SKU_ID INNER JOIN tbl_products AS p ON
    tbl_skus.SKU_ProductID = p.product_ID'.

    Access may require parenthesis ( ) around the JOINs when
    joining more than two tables

  • Syntax error (missing operator) in query expression

    Hi all
    I am creating a couple of pages where a dynamic list is created from an access database and then products from that list are displayed, the user then has the option of clicking more details, this then should pass the KITID over to the details page, However when i click on the details page i get the following error
    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
    [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'KitID = Kit 01'.
    /classicclocks/Kieninger_gallery.asp, line 21
    Here is the code from the page i am building, can anybody see anything obvious here
    strKitID = Request.QueryString("KitID")
    ' If KitID does not exist then redirect to Gallery page
    If strKitID = False Then
      Response.Redirect("kit_gallerytest.asp")
    End If
    ' SQL Query for specific KitID details only
    Dim objRS
    Set objRS = Server.CreateObject ("ADODB.Recordset")
    ' Open new objRS
      strSQL = "SELECT KitID,ImgKitCatalogue,KitDescriptionShort FROM tblMovements WHERE KitID = " & strKitID & " ORDER BY KitID"
      objRS.Open strSQL, MM_dbConn_STRING,,,adCmdTable
      ' Get all rows from table and asign values to array for use in form
      Do While Not(objRS.EOF)
      Images = True
      fsImagesArray = objRS.GetRows()
        Const arrKitID = 0
        Const arrImgKitCatalogue = 1
        Const arrKitDescriptionShort = 2
      Loop
    ' Close objConn and objRS
    objRS.Close
    strSQL = "SELECT * From tblMovements WHERE KitID = " & strKitID
    objRS.Open strSQL, MM_dbConn_STRING
    thanks
    John

    String values in a SQL where clause must be wrapped in quotes. Try this:
    strSQL = "SELECT KitID,ImgKitCatalogue,KitDescriptionShort FROM tblMovements WHERE KitID = '" & strKitID & "' ORDER BY KitID"

  • Java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax err

    I tried putting the square brackets and still get the same error. endasil suggested that the last value being inserted is not looking at the java code. I had earlier put +array. Now I replaced that with +a where a is a string representation of array elements. I still ahve a problem. How can I represent the array element in the query?
    String insertCommand = "INSERT into MetricOutput([A1],[A],[DRR],[DeRR],[RE],[WDRR],[WDeRR],[WRE],[ARF],[SRF],[HRF],[WARF],[WSRF],[WHRF],[SDC],[WSDC],[MAR],[WMAR],[H1],[H11],[H2],[H21],[Cluster]) "+
                             "VALUES("+comMappedCount+","+stdCount+","+DRR+","+DeRR+","+RE+","+WDRR+","+WDeRR+","+WRE+","+ARF+","+SRF+","+HRF+","+WARF+","+WSRF+","+WHRF+","+SDC+","+WSDC+","+MAR+","+WMAR+","+H1+","+H11+","+H2+","+H21+",+a)";

    It's quite hard to spot without code tags, but aren't you missing some quotes here:
    +",+a)"; instead of +","+a+")";I also don't know the Access sql syntax at all, but I am wondering if you don't need to surround all those arguments with single quotes. To avoid these kind of syntax errors in sql: use PreparedStatement. For more on this: http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html

  • How to solve System.Data.OleDbException (0x80040E14): Syntax error (missing operator) in query expression..

    The codes are..
     Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
            conn.ConnectionString = connstring
            If conn.State = ConnectionState.Closed Then
                conn.Open()
            Else
                MsgBox("Close")
            End If
            If (String.IsNullOrWhiteSpace(TextBox1.Text)) Then
                MessageBox.Show("PLEASE FILL IN ALL THE BOXES")
            ElseIf (String.IsNullOrWhiteSpace(TextBox2.Text)) Then
                MessageBox.Show("PLEASE FILL IN ALL THE BOXES")
            ElseIf (String.IsNullOrWhiteSpace(RichTextBox1.Text)) Then
                MessageBox.Show("PLEASE FILL IN ALL THE BOXES")
            End If
            Try
                Dim SqlQuery As String = "INSERT INTO Research (Title,Abstract,Proponents,Ryear) VALUES ('" & TextBox1.Text & "', '" & RichTextBox1.Text & "', '"
    & TextBox2.Text & "', '" & DateTimePicker1.Text & "')"
                Dim SqlCommand As New OleDbCommand
                With SqlCommand
                    .CommandText = SqlQuery
                    .Connection = conn
                    .ExecuteNonQuery()
                End With
                MsgBox("One record Succesfully Added")
            Catch ex As Exception
                MsgBox(ex.ToString)
            End Try
            Me.Close()
            main.Show()
        End Sub
    The situation is, I cannot add data if it is copied from the text from the ms word and paste it to the RichTextbox in my project..I can only add if I type Manually the data the richtextbox..If I copy paste it..this error comes out.
    Please help me to solve this problem..i attached the image of the error

    Windows Form forums are here.
    http://social.msdn.microsoft.com/Forums/windows/en-US/home?category=windowsforms
    or ASP.Net forums are over here.
    http://forums.asp.net/
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • Issue sourcing from Microsoft Access - Syntax error (missing operator)

    I apologize if this has been discussed before. I used the search and went through 7 pages of results, but didn't see a similar issue.
    I'm using Windows 7, ODI 11.1.1.5.
    I'm trying to source from a local MS Access DB to an Oracle DB.
    The session fails pretty much immediately (on step 3) - trying to pull data from the source table.
    "Syntax error (missing operator) in query expression"
    The source table is very simple and for this test I'm using no joins. Literally a 'select * from'.
    However - when I look at the SQL generated - it's wrong. It's got duplicate lines in the SQL and not all columns selected have a comma after and before the next column.
    If I run it direct on Access - I get the same error.
    If I clean up the SQL - it'll run fine on Access.
    I'm using the SQL to Oracle LKM.
    I wondered if it was something with the ODBC driver - so I've tried other versions of ODBC drivers for MS Access, and even switched the database itself from the Office 2007 format, back to 2003, and tried a driver for that.
    Same result.
    If I go to the model and right click and look for the data in the table - it displays fine. So obviously ODI can connect and see the data...
    So I guess my questions are:
    - is the SQL to Oracle LKM the correct one to source from Access ? I've even gone into it and specified MS Access as the source. Same result.
    - if it is the right one - what's going on ?? I've got to assume other people are pulling data from MS Access. Why the garbage SQL ? Clearly I'm missing something.
    - and finally - worst case - but is there a way for me to overwrite the SQL being generated so I can correct it myself. This will be a PITA since I'll be source from a bunch of tables - but at least it might be a temporary stop gap...
    thanks

    I'm going to mark this as closed for now. I solved the SQL issue. It was to do with the way the tables / fields were named and how the fields were being brought into the workflow. Tidying up there fixed the problem.
    Getting past that brought me to several other issues which I'm still working through. The current is an Invalid Fetch size error - but that appears to have been resolved in patch Doc ID: 13528165 in ODI 11g (ver 11.1.1.5.0)
    given the initial issue that I'd raised is no longer a concern - I'm closing.
    Edited by: 940843 on Jun 15, 2012 1:27 PM

  • Java.sql.SQLException: [Microsoft][ODBC Visual FoxPro Driver]Syntax error

    Hi all,
    I am able to INSERT and SELECT records from FoxPRo database successfully.
    The driver is Sun JDBC-ODBC bridge
    The DELETE statement throws no exception.
    I've tried to execute PACK after the DELETE call and got following exception:
    java.sql.SQLException: [Microsoft][ODBC Visual FoxPro Driver]File must be opened exclusively.So I tried USE MYTABLE EXCLUSIVE in a Statement before calling PACK and got the exception:
    java.sql.SQLException: [Microsoft][ODBC Visual FoxPro Driver]Syntax error or access violationI've also tried inserting the USE MYTABLE EXCLUSIVE before calling DELETE but got the same exception above.
    The ODBC DSN for MYTABLE is setup as:
    - Free Tables (not database)
    - Null (checked)
    - Deleted (checked)
    - Fetch data in background (checked)
    I am not able to issue any of the following commands to FoxPro using java
    OPEN - To open a table
    CLOSE - To close a table
    USE - To open a table for uer either in exclusive mode or shared mode
    The exception being generated is :
    java.sql.SQLException: [Microsoft][ODBC Visual FoxPro Driver]Syntax error or access violationThe help file of the Microsoft Visual Foxpro Driver states that the driver has support for the above commands.I a not able to get the way to issue the above commands to the driver using java.
    In setting up the ODBC DSN I saw no "read only" setting.
    In the Visual Foxpro table, I saw no READ ONLY settings.And also, there are no delete permission grants and there is no user database sesssion concept.
    I've tried all of the above with DSN mapped to a database(NOT free tables) and setting AUTO-COMMIT OFF and AUTO-COMMIT ON.But in vain. The same exceptions as those stated above persisted.
    Environment:
    Microsoft Windows XP Professional
    JDK version "1.4.2_09"
    Microsoft Visual Foxpro 06.00.8167
    Microsoft Visual Foxpro Driver 6.01.8629.01
    Don't know what else to try.
    Can anybody please help me.
    Thanks in advance
    Archana

    java.sql.SQLException: [Microsoft][ODBC Visual FoxPro Driver]File must be opened exclusively.
    In the Visual Foxpro table, I saw no READ ONLY settings.And also, there are
    no delete permission grants and there is no user database sesssion concept.
    The ODBC DSN for MYTABLE is setup as:
    - Free Tables (not database)
    - Null (checked)
    - Deleted (checked)If you're using Visual Foxpro database(.DBC), you should see "Exclusive" option too. You can try check it, but I don't know whether your issue will disappear.

  • Error: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]

    I am having a problem inserting/updateing date field of MS Access database with JDBC. I have tried several solutions. Serveral Field formats in the db and several methods with java. I will post my most recent attempt. I can read from the database I just can't write the date to the db, though I can write to any other field with a different datatype.
    Please don't bash me for using MS Access, it is my only option.
    Error: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]Error in row
    if (rs != null){
    while ( rs.next() ) {
    Date tDate;
              //Timestamp tDate;
              //String tDate;
    tDate = rs.getDate("Week");
              //tDate = rs.getTimestamp("Week");
              //tDate = rs.getString("Week");
              java.sql.Date sqlDate = new java.sql.Date( Date.getTime() );
              //java.sql.Timestamp sqlDate = new java.sql.Timestamp( tDate.getTime()
    System.out.println("Date: " + tDate );
    //System.out.println("Date: " + sqlDate );
    //System.out.println("Date: " + rs.getDate ("Date") );
    // 2004-03-24 00:00:00.0 this is Timestamp output
         Cpu.moveToInsertRow();
    Cpu.updateDate("Date_Col",sqlDate );
         //Cpu.updateDate("Date_Col",tDate );
         //Cpu.updateTimestamp("Date_Col", sqlDate);
         Cpu.insertRow();
    Error: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]Error in row
    Please help..........

    I can insert a new row and add all the fields (includeing date (as string)), but I have to use SQL statements. I cannot get the result set functions to work.
    I can retieve a rs just fine and print all the contents of the rs.
    My problem is with rs.updateRow();
    my code is below,
    public class Cpu_Load_Total_Cpu{
    public static void main(String[] args){
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String filename = "C:/dev/SHC/Cpu_Java/CFS_Health.mdb";
    String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
    database+= filename.trim() + ";DriverID=22;READONLY=false}";
    Connection con = DriverManager.getConnection( database ,"","");
    Statement stmt = con.createStatement(
    ResultSet.TYPE_SCROLL_INSENSITIVE,
    ResultSet.CONCUR_UPDATABLE);
         ResultSet Cpu = stmt.executeQuery("SELECT * FROM Cpu");
    if (Cpu != null){
         while ( Cpu.next() ) {
                   int tUsr, tSys, tWio, tIdle, tTotal_Cpu;
                   tUsr = Cpu.getInt("Usr");
                   tSys = Cpu.getInt("Sys");
                   tWio = Cpu.getInt("Wio");
                   tIdle = 100 - (tSys + tUsr + tWio);
                   tTotal_Cpu = tSys + tUsr + tWio;
                   Cpu.updateLong(8, tTotal_Cpu);
    //or Cpu.updateLong("Total_Cpu", tTotal_Cpu);
    // I get the same error as the post above
    // when I include the Cpu.updateRow(); call
                   Cpu.updateRow();
    // when excluded everything else runs fine, but
    // the db is not updated
    // as stated, everything prints to the screen or pipe when
    // updateRow is excluded
                   System.out.println("Usr: " + tUsr );
                   System.out.println("Sys: " + tSys );
                   System.out.println("Wio: " + tWio);
                   System.out.println("Total_Cpu: " + tTotal_Cpu);
                        con.commit();
                   stmt.close();
                   con.close();
    catch (Exception e) {
    System.out.println("Error: " + e);
    }

  • Error: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too

    Error: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
    I am getting above error in my sql to access database. The program works fine if I remove where clause. But I need where clause for my prgoram. Actually, I am trying to work on user management aspect and it won't allow me to do.
    String query = "select * from user where username="+name; s.execute(query);

    Thanks for the reply. Do you mean
    Can you please further explain. I have a value against which querry is run. Say that value is stored in
    String value; (stores the user names as string)
    and then i create a querry like
    String query = "select * from user where name= 'value'";
    s.execute(query);
    in above query
    user is table name
    name is a field which stores usersname.
    if I put 'value' it does not work but i put actual names 'xxx' it works. But I cannot put actual names here.

  • URGENT :: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]

    i am trying to execute the following query using jdbc
    String state = "select * from cs_test where Start_Time < DateAdd(\"s\",-19800,now()) AND End_Time >
    DateAdd(\"s\",-19800,now())";
    /java.sql.PreparedStatement querycs_test = c.prepareStatement(state);
    java.sql.Statement querycs_test= c.createStatement();
    java.sql.ResultSet rs = querycs_test.executeQuery(state);
    when i run the same query at the prompt in MS Access it works fine.
    The same line replaced with a simpler query works fine.
    but when i run the above i get an error
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

    Here's the value of your query before preparing it:
    select * from cs_test where Start_Time < DateAdd("s",-19800,now()) AND End_Time > DateAdd("s",-19800,now())My SQL refererence doesn't have anything about functions called DateAdd or now. It might be Microsoft specific, in which case when your organization converts to another database your query is going to stop working. Don't use vender specific extensions.
    Was your intention to call a Java method called DateAdd or now? Then your problem is a few missing quotes. Otherwise, I'm sorry I can't be of more help.

  • Java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]Optional fe

    Hello together!
    I am trying to add a long value to an access db.
    (I have a PreparedStatement.)
    But I get the following error:
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]Optional feature not implemented
         at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbc.SQLBindInParameterBigint(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setLong(Unknown Source)
         at Import.writeLineToDb(Import.java:70)
         at Import.main(Import.java:40)
    when exucuting the followint line:
    statement.setLong(2,new Long(data[1]).longValue());
    How can I find out which feature is missing and install it?
    Thanks.
    Markus

    Could it be that the driver is not installed for that?
    I am connecting like that:
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    connection = DriverManager.getConnection("jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ="+path, "", "");
    Thanks for your help.

Maybe you are looking for

  • Why does my apple ID always disabled when im entering my password in the game center?

    how many times i change my password because its always disanled for security reasons??only in game center application...

  • Thumbnail picture for .EPS or .PSD

    Moved from PSE 3 to 5, some questions... Question 1) Under windows explorer, when looking at the contents of a folder in thumbnail view, it does not give a thumbnail picture for .EPS or .PSD (Photoshop Elements 5.0) files, which is a real problem. If

  • Disk Utility - Erase Free Space - Creating Temporary File Freeze

    I used "Erase Free Space" with Disk Utility after trashing several files I no longer wanted on the hard drive or recovered.  I used  "Zero Out Deleted Files" option.  It took over 12 hours before an error message appeared "Your start up disk is almos

  • Common Keywords for Multiple Libraries

    Hello, I have a number of iPhoto libraries, each of which has its own set of Keywords. I now want to use a single set of Keywords to all the libraries. Is there a way to do this without having to manually edit the Keyword preferences for each library

  • Lenovo Y50 WiGig

    I have a stock Lenovo Y50 touch, 1080p screen, GTX 860m, 8gb RAMI have the stock WiFi card in it now but have been doing some research on intel's new WiGig and wireless docking.These Dell DW1601 WiGig cards are pretty cheap and easy to come by so my