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.

Similar Messages

  • 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 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?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • 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

  • [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

  • Help! This is driving me crazy. CASE statement report syntax error (missing operator)

    Hi
    Can anyone help with this SQL statement please. It uses a
    CASE statement but I keep getting back a syntax error (missing
    operator) error message. The SQL statement works without the CASE
    statement, so everything else is fine - its just when I put the
    CASE statement back in.
    Here's the SQL statement:-
    SELECT transactions.ourRef, transactions.transDate, CASE WHEN
    transactions.transTypeID = 2 THEN transactionDetails.goodsVatable *
    -1 ELSE transactionDetails.goodsVatable END,
    transactionDetails.goodsNonVat, transactionDetails.VAT,
    transactionDetails.grandTotal, clients.clientCode,
    transTypes.transTypeDesc
    FROM transactions, transactionDetails, clients, transTypes
    WHERE transactions.transID = transactionDetails.transID
    AND transactions.clientID = clients.clientID
    AND transactions.transTypeID = transTypes.transTypeID
    TransID = 2 means that its a credit not instead of an
    invoice, therefore I want the goods vatable returned as a negative
    number.
    Thanks in advance.
    Wez

    quote:
    ...the client wishes for me to use an MS Access db
    Too bad you didn't say that to begin with. I believe that
    with Access you might consider using IIF().
    Syntax:
    IIf(expr, truepart, falsepart)
    SELECT transactions.ourRef,
    transactions.transDate,
    IIf(transactions.transTypeID = 2,
    transactionDetails.goodsVatable * -1,
    transactionDetails.goodsVatable),
    transactionDetails.goodsNonVat,
    transactionDetails.VAT,
    transactionDetails.grandTotal,
    clients.clientCode,
    transTypes.transTypeDesc
    FROM transactions, transactionDetails, clients, transTypes
    WHERE transactions.transID = transactionDetails.transID
    AND transactions.clientID = clients.clientID
    AND transactions.transTypeID = transTypes.transTypeID
    Phil

  • How to solve this Data Configuration issue with error message ORA: 01017

    Bad public user name or password. ORA-01017: invalid username/password; logon denied
    How to solve this?

    I'm using JCreator jdk1.5.0_7.But i don't know how
    to use command prompt. When i execute my program, the
    command prompt showed
    Exception in thread "main"
    java.lang.NoClassDefFoundError: StringManipulation
    Press any key to continue...So you managed to compile your code since now you are running it. This error means that the class StringManipulation was not found. Usually an indicator that your classpath is incorrect.
    What did you do to generate this error? That is, how did you execute your program?
    [edit] if you did not compile your code then there is no class file StringManipulation.class and this error will appear.

  • How to dispaly System date time on Jsff page ?

    Friends,
    It would be simple question for you , Any one has idea about
    How to dispaly System date time on Jsff page using any expression laungage ?
    Thanks in Advance

    Hi,
    I have a solution for you I hope that is helps.
    add this to the top of your page...
    <jsp:useBean id="now" class="java.util.Date" scope="request" />
    so, you want the current date?
    <af:outputText value="#{now}"/>
    you can use the format for date also.
    I hope it is what you want.

  • How to convert system Date into DD-MMM-YYYY Format

    hi friends,
    please help me How to convert system Date into DD-MMM-YYYY Format.
    Regards
    Yogesh

    HI..
    data: w_dt(11) type c,
             w_month(2),
             w_mon(3).
    w_month = p_date+4(2). **p_date = given date**
    case w_month.
    when '01'.
    w_mon = 'Jan'.
    when '02'.
    w_mon = 'Feb'.
    when '03'.
    w_mon = 'Mar'.
    when '04'.
    w_mon = 'Apr'.
    when '05'.
    w_mon = 'May'.
    when '06'.
    w_mon = 'Jun'.
    when '07'.
    w_mon = 'Jul'.
    when '08'.
    w_mon = 'Aug'.
    when '09'.
    w_mon = 'Sep'.
    when '10'.
    w_mon = 'Oct'.
    when '11'.
    w_mon = 'Nov'.
    when '12'.
    w_mon = 'Dec'.
    endcase.
    Now...
      concatenate p_date6(2)  '-'  w_mon  '-'   p_date0(4)  into w_dt.
    write w_dt.

  • How to get system date??

    hi,can anybody tell me how to get system date in essbase?? i want to use it in calc script..Ayan

    The other thing you could do would be to write a custom macro or function to pull in the date or pass members to to do the comparisonGlenn S.

  • [ASK] How to get system date and substring / concate in data manager dynami

    Hello guys.
    I want to run package DM with the input have default value.
    The selection is look like this :
    Dimension : CATEGORY
    Source : PLAN_2011
    Destination : FORECAST_2011
    Dimension : TIME
    Source : 2011.JAN,2011.FEB,2011.MAR,2011.APR,2011.MAY,2011.JUN,2011.JUL,2011.AUG,2011.SEP,2011.OCT,2011.NOV,2011.DEC
    Destination : <same>
    How to get system date year and do the substring / concate ?
    So dimension category source will be PLAN_<YYYY>, destination = FORECAST_<YYYY>
    Dimension source = <YYYY>.JAN,<YYYY>.FEB,<YYYY>.MAR,<YYYY>.APR,<YYYY>.MAY,<YYYY>.JUN,<YYYY>.JUL,<YYYY>.AUG,<YYYY>.SEP,<YYYY>.OCT,<YYYY>.NOV,<YYYY>.DEC
    Depend on year system date.
    Thank you.

    Stuart,How are you storing OnSaleDate. If you are using OnSaleDate as an attribute dimension then you can write a Custom Defined Function to either:1- query your system for the current date and return the number of seconds that have elapsed since 1/1/1970. This is by definition the begining of the Epoch and how Essbase treats Attribute Dimensions of the Date type.public static long getDateInSeconds() {           Calendar cal = Calendar.getInstance();           return cal.getTime().getTime()/1000;}2- Write a Custom Defined Function that will accept the OnSaleDate and return the number of days sincepublic static double daysSince(double myDate) {     return (getDateInSeconds()-myDate )/86400;}

  • How to get system date and time?

    Can someone show me a code on how to get system date and time.
    Thanks!

    there is one really easy way to get system time, the api gives a great example of code on this. use gregorian calendar, which you'll find in the api under GregorianCalendar. You only need to create one instance of GC, ie Calendar time = new GregorianCalendar();
    you save seconds, minute and hours into int values, so you don't have to access the system time every second, you can create a thread which adds one to the int second value, if oyu see what i mean, for example, i have saved the hours, minutes and seconds as int values;
    int hour, minute, second;
    i can then create a thread (Thread thread = new Thread(this) and run it like:
    Calendar time;
    int hour, minute, second;
    Thread thread = null;
    public MyTime() {
    hour= time.get(Calendar.HOUR_OF_DAY);
    minute = time.get(Calendar.MINUTE);
    second = time.get(Calendar.SECOND);
    if(thread == null) {
    thread = new Thread(this);
    thread.start();
    public void run() {
    Thread t = Thread.currentThread();
    while(thread == t) {
    thread.sleep(1000);
    second++;
    if(second > 59)
    minute++;
    if(minute>59)
    hour++;
    formatTime();
    public void formatTime() {
    second = (second > 59? 0 : second);
    minute = (minute > 59? 0 : minute);
    hour = (hour > 23? 0 : hour);
    System.out.println(hour+":"+minute+":"+second);
    public static void main(String[] args) {
    new MyTime();
    I know this looks like gibberish but it should work. If not, try to fix the problem, i have written from memory really but i guarantee you, this gets the time then every second, simply adds one to the second and then formats time. You can also access the day, month and year then format them using the above code. I don't like giving code since you should really do these things yourself but it is 2:04am, i have nothing better to do and i am not tired so i did you a favour - i have become what i always did not want to, someone ho stays upall night writing code.

  • How to erase all data on macbook pro and reinstall operating system

    how to erase all data on macbook pro and reinstall operating system

    OS X Snow Leopard
    https://support.apple.com/en-us/HT3910
    http://www.thesafemac.com/how-to-reinstall-mac-os-x-from-scratch/
    OS X Yosemite
    https://support.apple.com/kb/PH18869?locale=en_US&viewlocale=en_US
    Best.

  • Syntax error on token "class", invalid Expression

    Hai,
    i am new to java beans and i have written the following code which gives an error
    Code jsp:
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>beancode</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <!--<form name="form1" action="beancode" method="POST"> -->
    Name: <input type="text" name ="nname"> <br><br><br>
    Address: <input type="text" name ="naddress"> <br><br><br>
         <input type = "submit" value="Submit">
    <% useBean id="sampl"; class="beancode.class"; scope="page"; %>
    <% setProperty name="sampl"; property="*"; %>
    <%--</jsp:useBean> --%>
    <table border="1">
              <tr><td>S.NO</td><td>NAME</td><td width="95">ADDRESS</td></tr>
    <%
              int count =1;
              while (rs.next())
         String name = rs.getString("Name");
              String address = rs.getString("ADDRESS");
    %>
              <tr>
                   <td>
    <%
                        out.print(count);
    %>               </td>
                   <td>
    <%                     out.println(name);
    %>                </td>
                   <td>
    <%                     out.print(address);
                        count++;
    %>               </td>
              </tr>
    <%          }
    %>
         </table>
    <!--</form> -->
    </body>
    </html>
    JAVA Class code:
    import java.sql.*;
    * @author
    public class beancode
    private String employid;
    private Connection con = null;
    // private ResultSet rs = null;
    private PreparedStatement st = null;
    String name, address;
    /** Creates a new instance of beancode */
    public beancode()
    {ok
    try
              Class.forName("com.mysql.jdbc.Driver");
              String url = "jdbc:mysql://localhost:3306/test";
              Connection con =DriverManager.getConnection(url,"root","shasi");
              Statement s = con.createStatement();
              ResultSet rs = s.executeQuery ("Select * FROM Test");
    catch(Exception e)
              System.out.println(e.getMessage());
    public void setemployid(String nname,String naddress)
              name = nname;
              address = naddress;
         public String getemployid()
              return(name);
         public String getemployadd()
              return(address);
    public void insert()
    try
    String s1="insert into samp values('"+name+"','"+address+"')";
    st = con.prepareStatement(s1);
    st.executeUpdate();
    st.clearParameters();
    st.close();
    catch(Exception m)
         public static void main(String args[])
                   beancode b = new beancode();
                   b.insert();
    The error
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 18 in the jsp file: /bean.jsp
    Generated servlet error:
    Syntax error on token "class", invalid Expression
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
         org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    PLEASE HELP ME OUT
    I AM WAITING PLEASE
    Thanks,
    Shasi

    You can try to use the xml form of tag use bean and not <% like this:
    <jsp:useBean id="sampl" class="beancode" scope="page" />
    <jsp:setProperty name="sampl"; property="*" />
    and in the class attribute specify the fully qualified class name without the extension

Maybe you are looking for

  • Low volume on Ipod Nano when playing through car stereo

    I used to own a 4 gig ipod mini, and I'd connect it to my car stereo via a stereo cassette adapter. Well, that little guy crashed after a few years of good hard use, and I bought an Ipod Nano. Only, when I play the Nano through my car stereo, the vol

  • Is there a limit on the size of an array?

    I have two arrays: array1 and array2. I have a function that is iterating through array1. If an item in the array matches a particular condition, then that item is pushed onto array2. I can successfully push up to 19 items onto array2. However, if I

  • Fixed Vendor

    Hello Friend We use SRM Server5.5 with classic scenario. (SP 07) Endusers want to change the source of supply.  So endusers delete the info-record and choose the preferred vendor. There is one info-record in MM. Even if enduser deletes the info-recor

  • Exporting Data Quality Statistics Into An Excel File Or Database

    Hi,            I would like to ask if it is possible to export the data profiling statistics into an excel file / flat file or a database table.            The output required by our development team is that we would like to be able to manipulate and

  • Resetting the Cache for a printer.

    Hi all. On the Spool Administration: Initial Screen screen, under the Devices\servers tab click the Output devices button. On the Spool Administration: List of Output Devices screen, double click on the printer you need to reset. On the Spool Adminis