Connecting to an access database

I am trying to connect to an access database using asp.net
vb.
I am getting a "unidentified error".
Any suggestions?

1. Post code for how you're connecting
2. Post procedure you went through to get that code
"sabafana" <[email protected]> wrote in
message
news:e4krqh$h07$[email protected]..
>I am trying to connect to an access database using
asp.net vb.
> I am getting a "unidentified error".
> Any suggestions?

Similar Messages

  • Using JSP to connect to an Access Database

    I need help on using JSP to connect to an Access database.
    This is the code I currently have connecting to a mySQL DB. I need to change it to connect to an Access DB. The reason I am switching DB's is because mySQL is no longer going to be carried by my host.
    Here is the code:
    <html>
    <head>
    <basefont face="Arial">
    </head>
    <body>
    <%@ page language="java" import="java.sql.*" %>
    <%!
    // define variables
    String UId;
    String FName;
    String LName;
    // define database parameters
    String host="localhost";
    String user="us867";
    String pass="jsf84d";
    String db="db876";
    String conn;
    %>
    <table border="2" cellspacing="2" cellpadding="5">
    <tr>
    <td><b>Owner</b></td>
    <td><b>First name</b></td>
    <td><b>Last name</b></td>
    </tr>
    <%
    Class.forName("org.gjt.mm.mysql.Driver");
    // create connection string
    conn = "jdbc:mysql://" + host + "/" + db + "?user=" + user + "&password=" +
    pass;
    // pass database parameters to JDBC driver
    Connection Conn = DriverManager.getConnection(conn);
    // query statement
    Statement SQLStatement = Conn.createStatement();
    // generate query
    String Query = "SELECT uid, fname, lname FROM abook";
    // get result
    ResultSet SQLResult = SQLStatement.executeQuery(Query);
         while(SQLResult.next())
              UId = SQLResult.getString("uid");
              FName = SQLResult.getString("fname");
              LName = SQLResult.getString("lname");
              out.println("<tr><td>" + UId + "</td><td>" + FName + "</td><td>" + LName
    + "</td></tr>");
    // close connection
    SQLResult.close();
    SQLStatement.close();
    Conn.close();
    %>
    </table>
    </body>
    </html>
    Thank You,
    Josh

    <%@ page language="java"%>
    <html>
    <head>
    <title>
    First Bean
    </title>
    <%@ page import="java.sql.*" %>
    </head>
    <body>
    <p>
    <%!
    Connection con;
    Statement st;
    ResultSet rs;
    String userid;
    String password;
    %>
    <%!public void db(JspWriter out)
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con=DriverManager.getConnection("jdbc:odbc:phani");
    catch(Exception e){}
    try{
    st=con.createStatement();
    rs=st.executeQuery("SELECT * FROM login");
    while(rs.next())
    userid=rs.getString("userid");
    password=rs.getString("password");
    out.println(userid);
    out.println("</br>");
    out.println(password);
         out.println("</br>");     
    }catch(Exception e){}
    try{
    con.close();
    }catch(Exception e){}
    %>
    <%db(out);%>
    </p>
    </body>
    </html>
    phani is dsn name
    login is table name
    Good luck
    phani

  • Trying to connect to an Access database

    Post Author: robert693
    CA Forum: Deployment
    Hello,
    I am trying to use Crystal to create reports out of an Access database. When I try to connect to the database thru the database expert, I go to Create Connection and choose Databse Files. I choose a database that is in My Documents. I get an error that says "Failed to load database information," and then "Unknown Query Engine Error." I was wondering what I have to do to connect to the Access database.
    Any help would be greatly appreciated!
    Robert 

    Post Author: [email protected]
    CA Forum: Deployment
    I connect to Access by first creating an ODBC connection to it and then have crystal use the ODBC.

  • Connect to remote Access database

    Hi there,
    Can any one tell me how to connect to the remote MS Access? The scnario is:
    Suppose there is a web server with IP 215.167.16.89. The JDBC driver (assumed to be JDataConnect) is installed on this machine. How to use this web server to connect to the Access database called db1.mdb with DSN 'db1' held in the maching with IP 165.247.17.43?
    The Jave connection codes I am using are:
    String url=new String ("jdbc:JDataConnect://165.247.17.43/db1:username:password");
    try{
    drvDriver=(Driver)Class.forName("JData2_0.sql.$Driver").newInstance();
    conConnection = drvDriver.connect(url, new Properties());
    showMessage("Connected to Company2 Database");
    Why can I not connect to the db1 database?
    If I use these codes to connect to the database in the same machine as the web server without specifying the IP address, it worked.
    String url=new String ("jdbc:JDataConnect:db1:username:password");
    Thanks in advance.

    Thanks for the help.
    So you need to give a full path of it as if you are accesing
    through windows explorer.I am not sure how to give a full path. Can you give me the detail please?
    What happens when you have two or more .mdb with the
    same name in different directories in that ip address.
    Since its a file... you need to access it as a file.I think we can specify the different DSN for the two or more .mdb databases.
    Thanks.

  • DW Procedures to connect to MS ACCESS database located on remote server

    I am confused about the procedures within Dreamweaver CS3 to connect to a MS ACCESS database on a remoter server.
    I am working through a tutorial book, "Dreamweaver 8 with ASP, Cold Fusion and PHP Training from the Source", but the instructions are unclear concerning the procedures to connect to a MS ACCESS database located on a remote server. 
    The book indicates that the server administration has to create the DSN for you and screen shots indicate that you will result in a list of DSNs to choose from when creating the connections .asp file.
    I went through the procedures to create a connections .asp and resulting in a connection without and tables (of course) because I do not initially have any connection information from my remote site.
    I have generated the required two lines of code as follows for my MS ACCESS database connection on my remote server:
    'Database connection info and provider
    strCon="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&_
    Server.MapPath("database\trans.mdb") & ";" &_
    "User ID=xxx;Password=xxxxx"
    The question that I have is:
    How does this connection coding relate to the "connections/conn_newland.asp" file that was create within the Dreamweaver screens?  How do I merge the ASP coding?  The file (/connections/conn_newland.asp) generated within Dreamweaver is as follows:
    <%
    'FileName="Connection_odbc_conn_dsn.htm"
    'Type="ADO"
    'DesignationType="ADO"
    'HTTP="true"
    'Catelog=" "
    'Schema
    Dim MM_conn_newland_STRING
    MM_conn_newland_STRINT = "dsn=newland;"
    %>
    Any advice would be appreciated.  I know that this is simple but debugging an error from an  ASP coding merge would be a "bear" to debug!

    I have not used MS Access myself (fortunately) but I believe it works much like the old, old way of achieving a multi-user database in FileMaker.
    That is, it is not a true client-server database but more a peer-to-peer database and that each peer opens the same database file which is available to multiple user via file sharing. Therefore as elikness said it should just be a matter of putting the files on your Lion Server and then sharing that folder/volume using SMB sharing.
    However one thing to be aware of, since MS Access is not a true client-server database I would imagine it uses record locking to manage simultaneous direct access to records in the same files. File or Record locking is something that has historically been a bit flakey when using Windows clients with a Mac file server (and probably vice versa).
    While I am not proposing it as a solution to consider seriously, it is worth you knowing that FileMaker Pro is a database system that is available for both Mac and Windows and depending on how you configure things can be considered to stretch from a configuration very similar to MS Access at the low end all the way to a high-end MS SQL Server style setup at the top end. See http://www.filemaker.com for details.
    There is also a a third-party tool available for migrating databases to or from FileMaker Pro and it can convert MS Access databases to FileMaker Pro see http://www.fmpromigrator.com/
    You could use FileMaker Pro just on Windows machines if you wish.

  • How to connect to ms access database in jdbc

    i want to connect to my ms access database located in my c:\tapi\dbexperts.mdb. please help me construct the connection string. thanks in advance for your help.

                   String database = "c:\\tapi\\dbexperts.mdb"; /* change it*/
                   String url = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=" + database + ";DriverID=22;READONLY=false";
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   con = DriverManager.getConnection(url);

  • Exception connecting to MS Access Database.

    I'm having problems using the jdbc-odbc bridge with an MS Access database and a file DSN. If I use a system DSN, it works fine but it does not seem to find the file DSN for some reason (And I HAVE to use a file DSN in this instance, for reasons I won't bore you with) - this is the error-message:
    "java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"
    This is my example code:
    import java.sql.*;
    public class SamplePgm {
    private static Connection con;
    private static Statement stmt;
    private static ResultSet result;
    public static void main(String[] args) {
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = DriverManager.getConnection("jdbc:odbc:Testing", "", "");
    stmt = conn.createStatement();
    result = stmt.executeQuery("select TOP 3 emp_no from employee");
    while (result.next()) {
    System.out.println(result.getString("emp_no"));
    } catch (Exception e) {
    e.printStackTrace();
    } finally {
    try {
    result.close();
    stmt.close();
    con.close();
    } catch (SQLException e) {
    e.printStackTrace();
    The file DSN was set up using the Win2K ODBC administrator.
    Is there any other way to tell ODBC that it's using a file DSN ?
    I'd be very grateful for any/all assistance.
    Thanks.

    My guess would be that a file DSN is stored in a file, a system DSN is stored under the HKeyLocalMachine registry key and a user DSN is stored under the HKeyCurrentUser registry key, but it's only a guess.

  • How to connect with Microsoft Access Database with JAVA

    I want to know the command and query to connect between MSAccess and JDBC.
    Is it beter way to make connection with MSAccess comparing with other Databases such as SQL and Oracle.
    Which Database will be the best with Java?
    I also want to know to be platform indepadent which database is suitable?

    On Windows, you can use MS Access database by:
    Set up a System Data Source using the ODBC control panel applet.
    Use the jdbc:odbc bridge JDBC driver, and specify a jdbc url that points to the data source name you just specified.
    It's been too long since I've done this, so I don't remember the syntax of the jdbc url, but I'm sure that if you do a search for the jdbc:odbc bridge that you will find what you are looking for.
    As far as the question about which database is best, you will need to determine that based on your project requirements.
    If you want a quick and dirty, open source, cross-platform database, take a look at HyperSonic SQL.
    - K

  • Breaking the Sharepoint connection within an Access database

    We have recently changed our online database to a new system. We downloaded all the current information into excel or access. However my major database to track all staff training, mandatory renewables and policy reviews will not allow attachments to be
    uploaded to the access database because "the sharepoint table is no longer available". We have had many problems with sharepoint, and wish to convert the database strictly to access and break the sharepoint connection to the former website. Is there
    a way to do this?
    Please advise

    Hi
    This is the forum to discuss questions about  Access develop. For your question is SharePoint related, I am moving this thread to the SharePoint forum
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share
    their knowledge or learn from your interaction with us.
    Thank you for your understanding.
    Best Regards
    Lan
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • CONNECT BI7 TO ACCESS DATABASE

    <Moderator Message: Don't use upper case letters; Don't request documentation or links; Search the forums; follow the rules>
    Hello,
    Is it possible to connect Microsoft Access database to BW.
    Should i use DB connect or UD connect.
    If someone could provide simple documentation
    thanks for you help,
    Edited by: Siegfried Szameitat on Dec 9, 2008 12:02 PM

    Hi there!
    I think data binding is being added to netbeans 6 next year, otherwise you will have to use JDBC to access the database and call setText for the field with the data you get out of the db (manual coding). Google for the jdbc odbc bridge for accessing Access DB.
    For data binding you can use Swing X http://www.swinglabs.org/projects.jsp, as long as you don't mind writing code by hand.
    In the mean time, if you really want to do the binding using drag and drop you can use the Visual Web pack for netbeans 5.5 and create a web based app with data binding. If you wait a week or two the final version (preview can be downloaded at the moment) of the web pack should be released.
    Sorry about the tone of the other guy's comment, it seems that Java programmers are traditionally hostile towards VB guys and how they view the world ;)

  • Cannot connect to an Access database from DreamWeaver

    Hello.
    I'm creating my first web page with a DB connection.
    I have a minimal DB with a simple table.
    This is a DB as Access create it by default, with no password
    and no
    security constraints.
    In DreamWeaver, I have created a default DB connection string
    for Access
    2000.
    I have removed, from this connection string, the UserID and
    the Password as
    there is no password for my DB.
    I have put the right path for this DB.
    But it doesn't work!
    I receive the message: (sorry for my bad english) cannot open
    the DB, it is
    already open by another user (it is not the case: the DB is
    closed) or you
    must have autorisation to visualised the data.
    Do you have an idea ?
    Alain.

    "chucknado" <[email protected]> a écrit
    dans le message de
    news:fbnon3$47m$[email protected]..
    > You might have a file or folder permissions problem.
    Please see the
    following:
    >
    >
    >
    http://livedocs.adobe.com/en_US/Dreamweaver/9.0/WSc78c5058ca073340dcda9110b1f693
    > f21-79f0.html
    >
    > Charles Nadeau
    > Dreamweaver
    > Adobe Systems
    >
    I'm not an expert in file permissions so I have simply moved
    my DB on the
    HDD of my PC, before it was on another server.
    So, now, I think I have no file permission problem anymore.
    I can connect the DB from DreamWeaver but I cannot see the
    tables !
    If I open the Tables node of the db tree in the Database
    window of
    DreamWeaver, I receive the message:
    "Error calling GetTables".
    Do you have an idea or an advice ?
    Thanks in advance,
    Alain.

  • Connection to ODBC access database failure

    I have made several sites using ACCESS databases via ODBC DSN
    name. But suddenly it does not work any more. I can not use the
    Database wizards in DM 8.02. When I have made a connection, tested
    it OK and I try to se the tables/views. I only got the word "none".
    If I in the advanced recordset wizard write the SQL command, the
    data is showen correctly!!???
    There is something wrong with DM's abillitry to connect to
    the ODBC DNS name...Everything is updateted to the latest version.
    Is there anybody who have any clue to what could be wrong. It
    is the same story on an old 2000 Server, a new 2003 small busines
    server and from DM installed on two different clientmaschines and
    on the two servers.

    Hi!
    You could try this It worked for me on all my connections.
    I found a extension called SP2DBFix1.0.2.mxp
    Down load here,
    http://download.macromedia.com/pub/dreamweaver/extensions/SP2DBFix1.0.2.mxp
    to fix a XP pro service pack2 connections.
    To fix: I went to Sites/Advanced/Remove connection Scripts,
    ran that removed
    my
    connection scripts. I then shut down Dreamweaver 8 installed
    the extension
    then opened dreamweaver 8 made a new connection and it works
    now Great! Im
    happy.
    You have to run this same routine on every site you have
    setup with
    connection scripts
    Good Luck.
    Dave
    "JOhnny Odgaard" <[email protected]> wrote
    in message
    news:ersvva$2hd$[email protected]..
    > I have made several sites using ACCESS databases via
    ODBC DSN name. But
    > suddenly it does not work any more. I can not use the
    Database wizards in
    DM
    > 8.02. When I have made a connection, tested it OK and I
    try to se the
    > tables/views. I only got the word "none". If I in the
    advanced recordset
    wizard
    > write the SQL command, the data is showen correctly!!???
    >
    > There is something wrong with DM's abillitry to connect
    to the ODBC DNS
    > name...Everything is updateted to the latest version.
    >
    > Is there anybody who have any clue to what could be
    wrong. It is the same
    > story on an old 2000 Server, a new 2003 small busines
    server and from DM
    > installed on two different clientmaschines and on the
    two servers.
    >

  • The Mystery of Connecting to an Access Database

    I am just starting to use designer and with some stumbles along the way have perfected the layout of the form I am trying to create. The next step is connecting it to a Microsoft Access database. However, I am having some problems.
    I have looked everywhere imaginable for a "how-to" on connecting an Access database to my form in Designer. I have gone through setting up data connections several times, all with the same result: "Connection for Source NPIF failed because the environment is not trusted". NPIF is the name of the data connection I've been trying to set up.
    I realize this is probably a very boring problem to solve, but I am desperate! I have not seen any answers to other posts asking this same question, so I'm worried this one will be overlooked too. Please, there are many of us out there who cannot figure this out! Help us?
    Other people seem to have set this up with no problems. Maybe one of you can post the steps you took to get it to work - share the love!!
    Thank you, Elizabeth

    Chris, here's my script. It's in the initialize event.<br /><br />----- ProjectInformationForm.Page1ClientBillingProject.Client.DataDropDownList::initialize - (JavaScript, client) <br /><br />/*     This dropdown list object will populate two columns with data from a data connection.<br /><br />     sDataConnectionName - name of the data connection to get the data from.  Note the data connection will appear in the Data View.<br />     sColHiddenValue      - this is the hidden value column of the dropdown.  Specify the table column name used for populating.<br />     sColDisplayText          - this is the display text column of the dropdown.  Specify the table column name used for populating.<br /><br />     These variables must be assigned for this script to run correctly.  Replace <value> with the correct value.<br />*/     <br /><br />var sDataConnectionName = "NPIF";          //     example - var sDataConnectionName = "MyDataConnection";<br />var sColHiddenValue = "ClientName";               //     example - var sColHiddenValue = "MyIndexValue";<br />var sColDisplayText = "ClientName";               //     example - var sColDisplayText = "MyDescription"<br /><br />//     Search for sourceSet node which matchs the DataConnection name<br />var nIndex = 0;<br />while(xfa.sourceSet.nodes.item(nIndex).name != sDataConnectionName)<br />{<br />     nIndex++;<br />}<br /><br />var oDB = xfa.sourceSet.nodes.item(nIndex);<br />oDB.open();<br />oDB.first();<br /><br />//     Search node with the class name "command"<br />var nDBIndex = 0;<br />while(oDB.nodes.item(nDBIndex).className != "command")<br />{<br />     nDBIndex++;<br />}<br /><br />//     Backup the original settings before assigning BOF and EOF to stay<br />var sBOFBackup = oDB.nodes.item(nDBIndex).query.recordSet.getAttribute("bofAction");<br />var sEOFBackup = oDB.nodes.item(nDBIndex).query.recordSet.getAttribute("eofAction");<br /><br />oDB.nodes.item(nDBIndex).query.recordSet.setAttribute("stayBOF", "bofAction");<br />oDB.nodes.item(nDBIndex).query.recordSet.setAttribute("stayEOF", "eofAction");<br /><br />//     Clear the list<br />this.clearItems();<br /><br />//     Search for the record node with the matching Data Connection name<br />nIndex = 0;<br />while(xfa.record.nodes.item(nIndex).name != sDataConnectionName)<br />{<br />     nIndex++;<br />}<br />var oRecord = xfa.record.nodes.item(nIndex);<br /><br />//     Find the value node<br />var oValueNode = null;<br />var oTextNode = null;<br />for(var nColIndex = 0; nColIndex < oRecord.nodes.length; nColIndex++)<br />{<br />     if(oRecord.nodes.item(nColIndex).name == sColHiddenValue)<br />     {<br />          oValueNode = oRecord.nodes.item(nColIndex);<br />     }<br />     else if(oRecord.nodes.item(nColIndex).name == sColDisplayText)<br />     {<br />          oTextNode = oRecord.nodes.item(nColIndex);<br />     }<br />}<br /><br />while(!oDB.isEOF())<br />{<br />      this.addItem(oTextNode.value, oValueNode.value);<br />       oDB.next();<br />}<br /><br />//     Restore the original settings<br />oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sBOFBackup, "bofAction");<br />oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sEOFBackup, "eofAction");<br /><br />//     Close connection<br />oDB.close();

  • Trying to connect GUI to access database

    i need alittle help i have this GUI that i created and i am trying to hook it up to a database in MS ACCESS and i am have so many problems trying to get my second table called billings to pull and show up in my GUI please take a look at my code and tell me what is wrong with it.
    now on my GUI its supposed to allow you to choose a company in the list box and after choosing a company, this allows you to get all the company's information like address and state and zip code and another list box is populated called consultants and you can choose a consultant and gethis or her billing information , like their hours billed from that company and their total hours billed
    please look at my code and tell me what is wrong, especially with the part about pulling information from the database.
    import java.sql.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Project extends Frame implements ItemListener, ActionListener
    //Declare database variables
    Connection conconsultants;
    Statement cmdconsultants;
    ResultSet rsconsultants;
    boolean blnSuccessfulOpen = false;
    //Declare components
    Choice lstNames = new Choice();
    TextField txtConsultant_Lname = new TextField(10);
    TextField txtConsultant_Fname = new TextField(10);
    TextField txtTitle = new TextField(9);
    TextField txtHours_Billed = new TextField(14);
    Button btnAdd = new Button("Add");
    Button btnEdit = new Button("Save");
    Button btnCancel = new Button("Cancel");
    Button btnDelete = new Button("Delete");
    Label lblMessage = new Label(" ");
    public static void main(String args[])
    //Declare an instance of this application
    Project thisApp = new Project();
    thisApp.createInterface();
    public void createInterface()
    //Load the database and set up the frame
    loadDatabase();
    if (blnSuccessfulOpen)
    //Set up frame
    setTitle("Update Test Database");
    addWindowListener(new WindowAdapter()
    public void windowClosing(WindowEvent event)
    stop();
    System.exit(0);
    setLayout(new BorderLayout());
    //Set up top panel
    Panel pnlTop = new Panel(new GridLayout(2, 2, 10, 10));
    pnlTop.add(new Label("Last Name"));
    lstNames.insert("Select a Name to Display", 0);
    lstNames.addItemListener(this);
    pnlTop.add(lstNames);
    pnlTop.add(new Label(" "));
    add(pnlTop, "North");
    //Set up center panel
    Panel pnlMiddle = new Panel(new GridLayout(5, 2, 10, 10));
    pnlMiddle.getInsets();
    pnlMiddle.add(new Label("Consultant_Lname"));
    pnlMiddle.add(txtConsultant_Lname);
    pnlMiddle.add(new Label("Consultant_Fname"));
    pnlMiddle.add(txtConsultant_Fname);
    pnlMiddle.add(new Label("Title"));
    pnlMiddle.add(txtTitle);
    pnlMiddle.add(new Label("Hours_Billed"));
    pnlMiddle.add(txtHours_Billed);
    setTextToNotEditable();
    Panel pnlLeftButtons = new Panel(new GridLayout(0, 2, 10, 10));
    Panel pnlRightButtons = new Panel(new GridLayout(0, 2, 10, 10));
    pnlLeftButtons.add(btnAdd);
    btnAdd.addActionListener(this);
    pnlLeftButtons.add(btnEdit);
    btnEdit.addActionListener(this);
    pnlRightButtons.add(btnDelete);
    btnDelete.addActionListener(this);
    pnlRightButtons.add(btnCancel);
    btnCancel.addActionListener(this);
    btnCancel.setEnabled(false);
    pnlMiddle.add(pnlLeftButtons);
    pnlMiddle.add(pnlRightButtons);
    add(pnlMiddle, "Center");
    //Set up bottom panel
    add(lblMessage, "South");
    lblMessage.setForeground(Color.red);
    //Display the frame
    setSize(400, 300);
    setVisible(true);
    else
    stop(); //Close any open connection
    System.exit(-1); //Exit with error status
    public Insets insets()
    //Set frame insets
    return new Insets(40, 15, 15, 15);
    public void loadDatabase()
    try
    //Load the Sun drivers
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    catch (ClassNotFoundException err)
    try
    //Load the Microsoft drivers
    Class.forName("com.ms.jdbc.odbc.JdbcOdbcDriver");
    catch (ClassNotFoundException error)
    System.err.println("Drivers did not load properly");
    try
    //Connect to the database
    conconsultants = DriverManager.getConnection("jdbc:odbc:Test");
    //Create a ResultSet
    cmdconsultants = conconsultants.createStatement();
    rsconsultants = cmdconsultants.executeQuery(
    "Select * from consultants; ");
    loadNames(rsconsultants);
    blnSuccessfulOpen = true;
    catch(SQLException error)
    System.err.println("Error: " + error.toString());
    public void loadNames(ResultSet rsconsultants)
    //Fill last name list box
    try
    while(rsconsultants.next())
    lstNames.add(rsconsultants.getString("Consultant_Lname"));
    catch (SQLException error)
    System.err.println("Error in Display Record." + "Error: " + error.toString());
    public void itemStateChanged(ItemEvent event)
    //Retrieve and display the selected record
    String strConsultant_Lname = lstNames.getSelectedItem();
    lblMessage.setText(""); //Delete instructions
    try
    rsconsultants = cmdconsultants.executeQuery(
    "SELECT c.Consultant_ID"+
    "c.Consultant_Lname"+
    "c.Consultant_Fname"+
    "c.Title"+
    "l.Client_ID"+
    "l.Client_Name"+
    "l.Address"+
    "l.City"+
    "l.State"+
    "l.Zip"+
    "b.Hours_Billed"+
    "b.Billing_Rate"+
    "b.Client_ID"+
    "b.Consultant_ID"+
    "FROM Consultants c, Clients l, Billing b"+
    "WHERE c.Consultant_ID = b.Consultant_ID"+
    "l.Client_ID = b.Client_ID"+
    "GROUP BY c.Consultant_ID");
    //"SELECT * FROM Consultants INNER JOIN Billing ON Consultants.Consultant_ID = Billing.Consultant_ID");
    //FROM Consultants INNER JOIN Billing ON Consultants.Consultant_ID = Billing.Consultant_ID;");
    //"Select * from consultants where [Consultant_Lname] = '" + strConsultant_Lname + "';");
    txtConsultant_Lname.setText(strConsultant_Lname);
    displayRecord(rsconsultants);
    setTextToEditable();
    catch(SQLException error)
    lblMessage.setText("Error in result set. " + "Error: " + error.toString());
    public void displayRecord(ResultSet rsconsultants)
    //Display the current record
    try
    if(rsconsultants.next())
    txtConsultant_Fname.setText(rsconsultants.getString("Consultant_Fname"));
    txtTitle.setText(rsconsultants.getString("Title"));
    txtHours_Billed.setText(rsconsultants.getString("Hours_Billed"));
    lblMessage.setText("");
    else
    lblMessage.setText("Record not found");
    clearTextFields();
    catch (SQLException error)
    lblMessage.setText("Error: " + error.toString());
    public void actionPerformed(ActionEvent event)
    //Test the command buttons
    Object objSource = event.getSource();
    if(objSource == btnAdd && event.getActionCommand () == "Add")
    Add();
    else if (objSource == btnAdd)
    Save();
    else if(objSource == btnEdit)
    Edit();
    else if(objSource == btnDelete)
    Delete();
    else if(objSource == btnCancel)
    Cancel();
    public void setTextToNotEditable()
    //Lock the text fields
    txtConsultant_Lname.setEditable(false);
    txtConsultant_Fname.setEditable(false);
    txtTitle.setEditable(false);
    txtHours_Billed.setEditable(false);
    public void setTextToEditable()
    //Unlock the text fields
    txtConsultant_Lname.setEditable(true);
    txtConsultant_Fname.setEditable(true);
    txtTitle.setEditable(true);
    txtHours_Billed.setEditable(true);
    public void clearTextFields()
    //Clear the text fields
    txtConsultant_Lname.setText("");
    txtConsultant_Fname.setText("");
    txtTitle.setText("");
    txtHours_Billed.setText("");
    public void Add()
    //Add a new record
    lblMessage.setText(" "); //Clear previous message
    setTextToEditable(); //Unlock the text fields
    clearTextFields(); //Clear text field contents
    txtConsultant_Lname.requestFocus ();
    //Set up the OK and Cancel buttons
    btnAdd.setLabel("OK");
    btnCancel.setEnabled(true);
    //Disable the Delete and Edit buttons
    btnDelete.setEnabled(false);
    btnEdit.setEnabled(false);
    public void Save()
    //Save the new record
    // Activated when the Add button has an "OK" label
    if (txtConsultant_Lname.getText().length ()== 0 || txtTitle.getText().length() == 0)
    lblMessage.setText("The Consultant's Last Name or Title is blank");
    else
    try
    cmdconsultants.executeUpdate("Insert Into consultants "
    + "([Consultant_Lname], [Consultant_Fname], Title, [Hours_Billed]) "
    + "Values('"
    + txtConsultant_Lname.getText() + "', '"
    + txtConsultant_Fname.getText() + "', '"
    + txtTitle.getText() + "', '"
    + txtHours_Billed.getText() + "')");
    //Add to name list
    lstNames.add(txtConsultant_Lname.getText());
    //Reset buttons
    Cancel();
    catch(SQLException error)
    lblMessage.setText("Error: " + error.toString());
    public void Delete()
    //Delete the current record
    int intIndex = lstNames.getSelectedIndex();
    String strConsultant_Lname = lstNames.getSelectedItem();
    if(intIndex == 0) //Make sure a record is selected
    //Position 0 holds a text message
    lblMessage.setText("Please select the record to be deleted");
    else
    //Delete the record from the database
    try
    cmdconsultants.executeUpdate(
    "Delete from consultants where [Consultant_Lname] = '" + strConsultant_Lname + "';");
    clearTextFields(); //Delete from screen
    lstNames.remove(intIndex); //Delete from list
    lblMessage.setText("Record deleted"); //Display message
    catch(SQLException error)
    lblMessage.setText("Error during Delete."
    + "Error: " + error.toString());
    public void Cancel()
    //Enable the Delete and Edit buttons
    btnDelete.setEnabled(true);
    btnEdit.setEnabled(true);
    //Disable the Cancel button
    btnCancel.setEnabled(false);
    //Change caption of button
    btnAdd.setLabel("Add");
    //Clear the text fields and status bar
    clearTextFields();
    lblMessage.setText("");
    public void Edit()
    //Save the modified record
    int intIndex = lstNames.getSelectedIndex();
    if(intIndex == 0) //Make sure a record is selected
    //Position 0 holds a text message
    lblMessage.setText("Please select the record to change");
    else
    String strConsultant_Lname = lstNames.getSelectedItem();
    try
    cmdconsultants.executeUpdate("Update consultants "
    + "Set [Consultant_Lname] = '" + txtConsultant_Lname.getText() + "', "
    + "[Consultant_Fname] = '" + txtConsultant_Fname.getText() + "', "
    + "Title = '" + txtTitle.getText() + "', "
    + "[Hours_Billed] = '" + txtHours_Billed.getText() + "' "
    + "Where [Consultant_Lname] = '" + strConsultant_Lname + "';");
    if (!strConsultant_Lname.equals(txtConsultant_Lname.getText()))
    //Last name changed; change the list
    lstNames.remove(intIndex); //Remove the old entry
    lstNames.add(txtConsultant_Lname.getText()); //Add the new entry
    catch(SQLException error)
    lblMessage.setText("Error during Edit. " + "Error: " + error.toString());
    public void stop()
    //Terminate the connection
    try
    if (conconsultants != null)
    conconsultants.close();
    catch(SQLException error)
    lblMessage.setText("Unable to disconnect");

    If you look at this web page at some of the other options, they may give you a clue on how to setup the Netgear.
    Wireless connection problems
    The main thing is to ensure that you give the two access points, fixed IP addresses outside of the DHCP range of the home hub.
    Try 192.168.1.15  and 192.168.1.16
    The Netgears probably are on the wrong IP subnet at the moment, so they will not work.
    There are some useful help pages here, for BT Broadband customers only, on my personal website.
    BT Broadband customers - help with broadband, WiFi, networking, e-mail and phones.

  • Refreshing Excel 2010 workbook with connection to Access database on shared network drive

    I have an Excel 2010 workbook that has a connection to an Access database that's on a shared drive on the company network. I can refresh the data in the regular Excel application but when it's hosted in the browser I get this error message "The data
    connection uses Windows Authentication and user credentials could not be delegated."
    Next, I installed PowerPivot for SQL server 2008 and used PowerPivot to connect to the same Access database. I uploaded it to a PowerPivot gallery but when I try to refresh the data but it says "the workbook was created in an older version of Excel
    and PowerPivot and cannot be refreshed until the file is upgraded." I tried to go to "Manage data refresh" but I get the "Sorry, something went wrong" page. Do I need to install PowerPivot for SQL server 2012 to do scheduled data refreshes?
    What about manual refreshes?

    I have an Excel 2010 workbook that has a connection to an Access database that's on a shared drive on the company network. I can refresh the data in the regular Excel application but when it's hosted in the browser I get this error message "The data
    connection uses Windows Authentication and user credentials could not be delegated."
    Next, I installed PowerPivot for SQL server 2008 and used PowerPivot to connect to the same Access database. I uploaded it to a PowerPivot gallery but when I try to refresh the data but it says "the workbook was created in an older version of Excel
    and PowerPivot and cannot be refreshed until the file is upgraded." I tried to go to "Manage data refresh" but I get the "Sorry, something went wrong" page. Do I need to install PowerPivot for SQL server 2012 to do scheduled data refreshes?
    What about manual refreshes?

Maybe you are looking for

  • Switch off the automatic update of profit centers on the Balance Sheet acco

    Dear all, In CO I am using only CCA and PCA. But I don't want to have the profit center updated on the balance sheet items. For example I have it activated for all the automatical BS postings from MM I need it only for the PL accounts. How can I swit

  • Zero timecode start for XDCAM EX files

    After importing 1280x720 24p Sony XDCAM EX files, Project window displays zero starting timecode. I'm using the CS3 Education version, but it's the up-to-date 3.2.0. I have read that others have experienced this while others have not. No matter how I

  • Posting of FM documents during GR/IR

    Hi all I am unable to post any FM documents when it comes to GR/IR clearing GL Codes. The commitment item attached with this GL code has Commitment Category = 3, Financial Transaction= 40. I have even tried passing a purely FI entry but the system do

  • Unexpected type error

    I am getting an unexpected type error in the following code: import java.awt.Graphics2D; import java.awt.geom.Ellipse2D; import java.awt.geom.Line2D; import java.awt.geom.Point2D; public class Line    public Line(int aClick, Point2D.Double[] aPoint)

  • Sum in Dynamic internal table

    Hi Gurus, I want to print sum of a particular coloumn in dynamic internal table, But in Field symbold use char type so i cant able to print sum. help me to solve this problem. Regards, Bhuvana.