MS Jet Engine Problems with Left Join  
Author Message
StuDawg028





PostPosted: 2006-1-10 22:03:45 Top

dreamweaver, MS Jet Engine Problems with Left Join I have been trouble using a left join in my SQL Statement that accesses a MS
Access database I created from a developer tutorial making a forum. I've made
the database and have setup the connection correctly and have been able to
query the database, but I get an error when I try and use a left join. I think
my syntax may be wrong - I've tried several variations.

Here is my original SQL statement:
SELECT *
FROM message_msg LEFT JOIN user_usr ON idusr_msg = id_usr
WHERE idtop_msg = #URL.id_top#

-1:com.inzoom.adojni.ComException: Join expression not supported. in Microsoft
JET Database Engine code=3092 Type=1 Query: SELECT *
FROM message_msg LEFT JOIN user_usr ON idusr_msg = id_usr
WHERE 0 = 1 Join expression not supported.
com.inzoom.adojni.ComException: Join expression not supported. in Microsoft
JET Database Engine code=3092 Type=1
at com.inzoom.ado.Recordset.jniOpenCmd(Native Method)
at com.inzoom.ado.Recordset.open(Recordset.java:88)
at com.inzoom.jdbcado.Statement.createRs(Statement.java:26)
at com.inzoom.jdbcado.Statement.executeQuery(Statement.java:47)
at
coldfusion.server.j2ee.sql.JRunStatement.executeQuery(JRunStatement.java:111)
at
coldfusion.rds.DbFuncsServlet$DbSqlStatementOperator.processCmd(DbFuncsServlet.j
ava:409)
at coldfusion.rds.DbFuncsServlet.processCmd(DbFuncsServlet.java:78)
at coldfusion.rds.RdsServlet.doPost(RdsServlet.java:57)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at coldfusion.rds.RdsFrontEndServlet.doPost(RdsFrontEndServlet.java:102)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
at
jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:318)
at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:426)
at
jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:264)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
com.inzoom.jdbcado.JdbcAdoException: com.inzoom.adojni.ComException: Join
expression not supported. in Microsoft JET Database Engine code=3092 Type=1
Query: SELECT *
FROM message_msg LEFT JOIN user_usr ON idusr_msg = id_usr
WHERE 0 = 1 Join expression not supported.
at com.inzoom.jdbcado.Statement.createRs(Statement.java:28)
at com.inzoom.jdbcado.Statement.executeQuery(Statement.java:47)
at
coldfusion.server.j2ee.sql.JRunStatement.executeQuery(JRunStatement.java:111)
at
coldfusion.rds.DbFuncsServlet$DbSqlStatementOperator.processCmd(DbFuncsServlet.j
ava:409)
at coldfusion.rds.DbFuncsServlet.processCmd(DbFuncsServlet.java:78)
at coldfusion.rds.RdsServlet.doPost(RdsServlet.java:57)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at coldfusion.rds.RdsFrontEndServlet.doPost(RdsFrontEndServlet.java:102)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
at
jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:318)
at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:426)
at
jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:264)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

Here is a variation:

SELECT *
FROM message_msg LEFT JOIN user_usr ON message_msg.idusr_msg = user_usr.id_usr
WHERE idtop_msg = #URL.id_top#

When I test this statement, I receive the error:

-1:com.inzoom.adojni.ComException: No value given for one or more required
parameters. in Microsoft JET Database Engine code=3088 Type=1 Query: SELECT *

FROM message_msg LEFT JOIN user_usr ON message_msg.idusr_msg = user_usr.id_usr
WHERE 0 = 1 No value given for one or more required parameters.



com.inzoom.adojni.ComException: No value given for one or more required
parameters. in Microsoft JET Database Engine code=3088 Type=1

at com.inzoom.ado.Recordset.jniOpenCmd(Native Method)
at com.inzoom.ado.Recordset.open(Recordset.java:88)
at com.inzoom.jdbcado.Statement.createRs(Statement.java:26)
at com.inzoom.jdbcado.Statement.executeQuery(Statement.java:47)
at
coldfusion.server.j2ee.sql.JRunStatement.executeQuery(JRunStatement.java:111)
at
coldfusion.rds.DbFuncsServlet$DbSqlStatementOperator.processCmd(DbFuncsServlet.j
ava:409)
at coldfusion.rds.DbFuncsServlet.processCmd(DbFuncsServlet.java:78)
at coldfusion.rds.RdsServlet.doPost(RdsServlet.java:57)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at coldfusion.rds.RdsFrontEndServlet.doPost(RdsFrontEndServlet.java:102)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
at
jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:318)
at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:426)
at
jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:264)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

com.inzoom.jdbcado.JdbcAdoException: com.inzoom.adojni.ComException: No value
given for one or more required parameters. in Microsoft JET Database Engine
code=3088 Type=1 Query: SELECT *

FROM message_msg LEFT JOIN user_usr ON message_msg.idusr_msg = user_usr.id_usr
WHERE 0 = 1 No value given for one or more required parameters.

at com.inzoom.jdbcado.Statement.createRs(Statement.java:28)
at com.inzoom.jdbcado.Statement.executeQuery(Statement.java:47)
at
coldfusion.server.j2ee.sql.JRunStatement.executeQuery(JRunStatement.java:111)
at
coldfusion.rds.DbFuncsServlet$DbSqlStatementOperator.processCmd(DbFuncsServlet.j
ava:409)
at coldfusion.rds.DbFuncsServlet.processCmd(DbFuncsServlet.java:78)
at coldfusion.rds.RdsServlet.doPost(RdsServlet.java:57)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at coldfusion.rds.RdsFrontEndServlet.doPost(RdsFrontEndServlet.java:102)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
at
jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:318)
at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:426)
at
jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:264)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

Would anyone be able to help me out with this problem? I would appreciate all
the help you can give me. Thanks.


 
Lionstone





PostPosted: 2006-1-10 22:16:00 Top

dreamweaver >> MS Jet Engine Problems with Left Join Don't abbreviate the join type and see what happens. (A LEFT OUTER JOIN B ON
A.Field=B.Field)


 
Spacecase3785





PostPosted: 2006-1-11 3:33:00 Top

dreamweaver >> MS Jet Engine Problems with Left Join Is idtop_msg in message_msg or user_usr ?

If you'll notice:

WHERE 0 = 1
this is how it was parsed (always empty set...)

If idtop_msg is in user_usr then your join needs a nested select with the
WHERE statment in it. (don't forget the parenthesis)

Also, it is always better to specify fields with table.field, this will avoid
ambiguity...

 
 
Spacecase3785





PostPosted: 2006-1-11 3:53:00 Top

dreamweaver >> MS Jet Engine Problems with Left Join Also, use Response.Write(strSQL) to debug SQL that way you can see what is actually sent, where strSQL is the SQL string you are building...