In my opinion, it's easier to just use a PreparedStatement and forget all
the escaping.  When you use a PreparedStatement, it becomes the JDBC
Driver's job to escape the characters that the database doesn't understand,
so change your code to con.prepareStatement("insert into table (row1, row2,
row3) values(?, ?, ?)");  Then just call one of the setXxx methods on the
prepared statement and execute it.
    (*Chris*)

----- Original Message -----
From: "Sanjay" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 27, 1999 12:24 AM
Subject: MS Access problem


Hi all,
        I'm using JDBC thru a Servlet to perform SQL queries/updates on a MS
Access database (mdb file). However when i try to insert into a 'Text' type
field, i get an error "illegal query string" from MS Access. I have noticed
that it is because of the '|' (pipe) character. Is '|' an invalid character
in MS Access ? If so, how can we 'Escape' it ? And are there other
characters in Access that we need to Escape ? I have tried to search for
this in MS Access help files, but in vain.......

I'll be much obliged if someone helps me out here......and sorry for the
Off- topic question........

TIA,
Sanjay

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to