Hej der ude er der nogen der har en ide om hvorfor jeg får denne fejl
Udkast af Min fil
/****************************************
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc
bc:TLFliste";
Connection forb = DriverManager.getConnection(url,"","");
Statement stmt = forb.createStatement();
String query;
query = "SELECT Fornavn, Efternavn, LokalNr, RumNr FROM Bruger
ORDER BY "+order;
if(text != "null" && text != "NULL")
query = query + " WHERE LokalNr like " + text + " OR RumNR like
\"%" + text + "%\" OR Fornavn like \"%" + text + "%\" OR Efternavn like \"%"
+ text + "%\"";
out.println("<br><u><b>"+query+"</b></u><br>");
ResultSet rs = stmt.executeQuery(query);
/****************************************
query
/****************************************
SELECT Fornavn, Efternavn, LokalNr, RumNr FROM Bruger ORDER BY LOKALNR WHERE
LokalNr like A OR RumNR like "%A%" OR Fornavn like "%A%" OR Efternavn like
"%A%"
/****************************************
Fejlmeddelelse
/****************************************
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax
error (missing operator) in query expression 'LOKALNR WHERE LokalNr like A
OR RumNR like [%A%] OR Fornavn like [%A%] OR Efternavn like [%A%]'. at
sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6106) at
sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6263) at
sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(JdbcOdbc.java:2525) at
sun.jdbc.odbc.JdbcOdbcStatement.execute(JdbcOdbcStatement.java:337) at
sun.jdbc.odbc.JdbcOdbcStatement.executeQuery(JdbcOdbcStatement.java:252) at
SimpleServlet.HentAfData(SimpleServlet.java:97) at
SimpleServlet.doGet(SimpleServlet.java:44) at
SimpleServlet.doPost(SimpleServlet.java:12) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247) at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193) at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:243) at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66) at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:201) at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66) at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
46) at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64) at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
) at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66) at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170) at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64) at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
) at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64) at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462) at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64) at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:163) at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66) at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
1011) at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106
) at java.lang.Thread.run(Thread.java:536) 1
/****************************************
Er der nogen der kan hjælpe.
MvH
Michael Houmaark