MS access - whats the story?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ed_Wallace
Posted On:   Tuesday, August 20, 2002 01:11 AM

Hi, two questions for anyone who can answer them. I have a piece of code that perform a search (shown below)......... rec2 = st2.executeQuery("SELECT * FROM banklist Where ShortName ='" + bankStr + "';"); this statement works but if I add anything to it, for example "WHERE SWIFT ='27'" then it no longer works, even when I know for sure that the data is there. If I try the SQL in access it works and retrieves the data correctly. Why is this happening? my second question is related, how do I call a query that I have in ms access from Java (and how do I pass it parameters)? any help gratefully recieved.    More>>

Hi, two questions for anyone who can answer them.


I have a piece of code that perform a search (shown below).........

rec2 = st2.executeQuery("SELECT * FROM banklist Where ShortName ='" + bankStr + "';");

this statement works but if I add anything to it, for example "WHERE SWIFT ='27'" then it no longer works, even when I know for sure that the data is there. If I try the SQL in access it works and retrieves the data correctly.
Why is this happening?




my second question is related, how do I call a query that I have in ms access from Java (and how do I pass it parameters)?


any help gratefully recieved.

   <<Less

Re: MS access - whats the story?

Posted By:   Gautam_Marwaha  
Posted On:   Tuesday, August 20, 2002 01:22 AM

1. something like

"SELECT * FROM banklist Where ShortName ='" + bankStr + "' and SWIFT = 27"
shd work ok - whether or not there is data in banklist table. (Assuming SWIFT column is of type number otherwise use SWIFT = '27')

2. IMHO this isn't possible within the boundary of JDBC as saved queries is a MSAccess specific feature.

About | Sitemap | Contact