Hi there! I've encountered the following problem when I moved from JDBC-ODBC bridge to JDBC Type 4 drivers. In my code I execute the following query: if exists( SELECT email FROM AccessDB WHERE AccessID=1 ) select res=1 else select res=0 It works fine with JDBC-ODBC Bridge. But when I use Merant's drivers, I get the exception: java.sql.SQLException: [Allaire JRun][SQLServer JDBC Driver][SQLServer]Line 1: Incorrect syntax near ')'. When I use MS SQL Profiler, I see that another string is in the query: if exists( SELECT email FROM AccessDB WHERE AccessID=1 select res=1 else select res=0) Obviously It is incorrect. But the question is: Why I pass correct string to Statement.execute() and get incorrect query to SQL database? Why there is no such effect with JDBC-ODBC? I only change Datasource properties in the JMC. Some other queries work normally. Regards, Vit Shorin. P.S. The exact stack trace. java.sql.SQLException: [Allaire JRun][SQLServer JDBC Driver][SQLServer]Line 1: Incorrect syntax near ')'. at allaire.jrun.db.jdbc.base.BaseExceptions.getException(BaseExceptions.java:72 ) at allaire.jrun.db.jdbc.sqlserver.tds.TDSRequest.processErrorToken(TDSRequest.j ava:401) at allaire.jrun.db.jdbc.sqlserver.tds.TDSRequest.processReplyToken(TDSRequest.j ava:1571) at allaire.jrun.db.jdbc.sqlserver.tds.TDSExecuteRequest.processReplyToken(TDSEx ecuteRequest.java:146) at allaire.jrun.db.jdbc.sqlserver.tds.TDSRequest.processTokensInReply(TDSReques t.java, Compiled Code) at allaire.jrun.db.jdbc.sqlserver.tds.TDSRequest.processReply(TDSRequest.java:1 661) at allaire.jrun.db.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(SQLS erverImplStatement.java:567) at allaire.jrun.db.jdbc.base.BaseStatement.commonExecute(BaseStatement.java:885 ) at allaire.jrun.db.jdbc.base.BaseStatement.executeQuery(BaseStatement.java:790) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
