Hi!
I'm trying to access a Microsoft access database.
The code is (JSP) :
<%@ page language="java" contentType="text/html" import="java.sql.*" %>
<%
Object rsValue = null;
// Load MSDE JDBC driver
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// Open up Access database
String DSNName = "Intranet_exam.dsn";
String dbURL = "jdbc:odbc:" + DSNName;
Connection Conn = DriverManager.getConnection(dbURL);
// Create statement object for sending SQL Queries
Statement Stmt = Conn.createStatement();
// Place results in ResultSet object
String searchTerm = request.getParameter("searchTerm");
ResultSet rs = Stmt.executeQuery("SELECT count(*) from examTimes");
// Clean up objects:
%>
<% if(rs != null){%>
<%= rs.getInt(1) %>
<%
}else{%>
RS is null
<%}%>
However this produces the exception:
[Microsoft][ODBC Driver Manager] Invalid cursor state
Is this trying to say that the result set is empty?
I've tried moving the cursor to 'before first', but the table is locked to 'forward movement only'
Any help would be great!
Thanks
Alastair