MS Works DB

From: Phil... (rynes_at_ieee.org)
Date: 10/17/03


Date: Fri, 17 Oct 2003 19:30:50 GMT

I got the program listed below to work on my
Win NT 4.0 machine with an Access database.
It just prints out name and email. I got a new
laptop with Win XP Pro. that has MS Works
database, not Access. File type is ".wdb"
The "ODBE data source administrator" doesn't have
a driver for wdb, only mdb, dbf, and xls.
I tried to find something on the MS site, but it is
so huge I could have easily missed it.
I would like to have a JDBC driver too.
Any help appreciated.
tnx, phil....
------------------
import java.sql.*;
public class DataBase {
    public static void main(String[] args) {
        String data = "jdbc:odbc:YahooAddrBook"; // data base friendly name
        try {
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            Connection conn = DriverManager.getConnection(
                data, "", "");
            Statement st = conn.createStatement();
            String q =
                "SELECT * " +
                "FROM yahoo_ab " + // table name
                "WHERE (\"Last Name\" LIKE '"+ args[0]+"') "+
                "ORDER BY (\"First Name\")";
                System.out.println(q);
            ResultSet rec = st.executeQuery(q);
            while(rec.next()) {
                System.out.println(
                          rec.getString("First Name") + ", "
                        + rec.getString("Last Name") + ", "
                        + rec.getString("E-Mail Address") + ".");
            }
            st.close();
        } catch (Exception e) {
            System.out.println("Error -- " + e.toString());
            e.printStackTrace();
        }
    }
}



Relevant Pages

  • Concurrency Violation in DataSet Update ADO.NET
    ... Now I am developing Cheque Writing ... 'UPDATE DATABASE ... "TBKKTC") ... I use password to protect my Access database from ...
    (microsoft.public.dotnet.general)
  • Re: formatting columns
    ... This works for columns either to the left or right of the cell to be copied. ... >> I am preparing to set up a database in Access2002. ... >> have the time to set up the Access database so I must do ... >> my data entry into Excel. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Web Wiz Forums in New Subweb, Published with FP2003
    ... Whenever I download an Access database and prior to re-uploading I always do a compact and repair ... General rule once your forum is active, you should never download and then re-upload the ... FrontPage Resources, WebCircle, MS KB Quick Links, etc. ...
    (microsoft.public.frontpage.client)
  • Re: formatting columns
    ... >> I am preparing to set up a database in Access2002. ... He knows how to use Excel on a limited ... >> have the time to set up the Access database so I must do ... >> in the first cell, and then having to drap it down the ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Failure of Linked table in Access...
    ... SQL Server database via an ODBC DSN. ... in the Access database with various forms and reports. ... error and all subsequent queries on the PROJ table fail. ... The table is one of many tables that are linked from SQL Server ...
    (microsoft.public.access.modulesdaovba)