Try to use the % char instead of the *
in your query (that is the appropriate ODBC convention)
nicolas germain
akazi technologies - france
-----Message d'origine-----
De : Nitin Kulkarni <[EMAIL PROTECTED]>
� : [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date : jeudi 15 juillet 1999 13:26
Objet : Using 'Like' Query on MS-ACCESS Database
|Hello All
|
|We are trying to develop an servlet which talks with the MS-ACCESS
|database.
|
|We are also using prepared statement in the process. However we are
|facing problems in supplying parameters to the query at run time
|
|The querystring is as follows
|
|"Select * from Empdet where Empfname like ? AND Emplname like ? ";
|
|We are accepting the first name and last name from the HTML page.
|
|To run on the Ms-Access the query should be like this
|
|Select * from Empdet where Empfname like '*<some char>*' AND Emplname
|like '*<some char>*' ";
|
|So we appended the '* and *' chars to the data accepted from the user
|and then inserted in the place of ? marks(place holders) using the
|setString() method.
|
|However the query deos not run successfully and returns a null
|resultset.
|
|Could any of you please help us with the construction of the query?
|
|Also is there any way we can know what the final query looks like after
|the ? marks have been replaced?
|
|Thanks
|
|Nitin Kulkarni
|
|Pune
|India
___________________________________________________________________________
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