Unable to connect report to database on client machine

I am using C# and Visual Studio 2010 with several Crystal Reports embedded into my application as resources.  This is a Windows application running on Vista.  I am trying to connect to a SQL Server database.  I created the reports using the design wizard in VS.  I am allowing for the server and database name to be changed at runtime through values stored in the project manifest.
As experienced by hundreds of other frustrated developers, my reports run fine on my development machine but fail on my client machine.  On the client machine I am prompted with a database login window.  The server name is properly populated with the server name pulled from the ...exe.config file.  The database name is blank and the field is disabled.  The integrated security checkbox is not checked.  I am programatically providing the server name, the database name and specifying integrated security to be true using sample code I found on this forum.  See below. 
I reviewed the Troubleshooting Guide to Database Connectivity Issue with Crystal Reports in Visual Studio .NET Applications.  Accordingly, I am running the SP1 for Visual Studio 2010 on my development machine and the most recent runtime module on the client machine.
Here is my application code.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CrystalDecisions.CrystalReports.Engine; //jp
using CrystalDecisions.Shared; //jp
namespace WindowsFormsApplication1
    public partial class FormRptArtist : Form
        private CrystalReport1 crReportDocument = new CrystalReport1();
        public FormRptArtist()
            InitializeComponent();
        private void FormRptArtist_Load(object sender, EventArgs e)
            try
                ConnectionInfo connectionInfo = new ConnectionInfo();
                connectionInfo.IntegratedSecurity = true;
                connectionInfo.ServerName = Properties.Settings.Default.CrystalServer;   // SQLExpress
                connectionInfo.DatabaseName = Properties.Settings.Default.CrystalDatabase;   // TriviaProd
                SetDBLogonForReport(connectionInfo, crReportDocument);
                SetDBLogonForSubreports(connectionInfo, crReportDocument);
                crystalReportViewer1.ReportSource = crReportDocument;
            catch (Exception exp)
                MessageBox.Show(exp.Message);
        private void SetDBLogonForSubreports(ConnectionInfo connectionInfo, ReportDocument reportDocument)
            Sections sections = reportDocument.ReportDefinition.Sections;
            foreach (Section section in sections)
                ReportObjects reportObjects = section.ReportObjects;
                foreach (ReportObject reportObject in reportObjects)
                    if (reportObject.Kind == ReportObjectKind.SubreportObject)
                        SubreportObject subreportObject = (SubreportObject)reportObject;
                        ReportDocument subReportDocument =
                            subreportObject.OpenSubreport(subreportObject.SubreportName);
                        SetDBLogonForReport(connectionInfo, subReportDocument);
        private void SetDBLogonForReport(ConnectionInfo connectionInfo, ReportDocument reportDocument)
            Tables tables = reportDocument.Database.Tables;
            foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
                TableLogOnInfo tableLogonInfo = table.LogOnInfo;
                tableLogonInfo.ConnectionInfo = connectionInfo;
                table.ApplyLogOnInfo(tableLogonInfo);

Hello,
Install the MS SQL Server Client tools on your PC and when setting location use the MS SQL Native 10 client as your database driver.
Only one MS supports for Server 2008, there is a MS Kbase on this, you can't use MDAC version of the SQL Client engine.
Then update your app to use RAS and search in this forum on ReplaceConnection_click and you'll find my sample code on how to set location to use the new DB server and connection properties.
If that doesn't work then try hard coding the log on info rather than using variables. At the same time, unfortunately SQL Express doesn't have the Management Console, you want to watch the server using Profiler to see what your app is actually sending to the Server. If you have a full version of SQL 2008 then you can monitor what is going on. If not then you'll ahve to find some other tool you can use.
Try ODBC, you can enable ODBC Trace to see is all other options are not available.
If that doesn't work post to MS's forum and ask them why you connection info isn't working.
Thank you
Don

Similar Messages

  • Suddenly unable to connect Reports to database: ORA 12154 TNS can't resolve

    Beginning end of last week, the Reports development tool (rwbuilder v10.1.2.0.2) suddenly lost the ability to connect to the database. The error is ORA-12154: TNS: could not resolve the connect identifer specified.
    However, nothing has changed on either the database or my workstation. SQL*Developer and the Network Administrator can both access the database, confirming the configuration of TNSNAMES.
    A fresh install of the DevSuite (rwbuilder v9 something) onto another workstation yielded the same error. The problem seems to be with Reports, not my workstation, my TNSNAMES configuration, or the database itself.
    What could possibly cause the database to reject only Reports?

    Well, continued searching this forum revealed the answer. It was found in:
    ORA - 12154 - Unable to resolve TNS..
    It seems that something did, indeed, change on my workstation. I renamed all of the TNSNAMES.ORA files other than the one used by the network administrator. It seems that Oracle*Reports requires its own copy of the TNSNAMES file. What I don't understand is how it gets updated when changes are made to the real TNSNAMES file via the network administrator.
    In any event, I'm back up and running. Sorry for the wasted bandwidth.

  • Unable to connect to 10g database from developer suite 10g

    I have loaded oracle 10g on my server with OS windows 2003 and it is working fine.Now I have installed Oracle developer suite 10g on windows XP client . we have configured local listener also and its entry is found in tnsnames.ora
    My database name is mbxdata .
    I have defined my host name as
    MBXDATA.mbxnet.com in tnsnames but I am unable to connect to the database since I get error as ORA-12154 : TNS :could not resolve the connect identifier specified.
    Please suggest matter urgent.
    Thanks in advance

    We are having the same issue now. Was this ever resolved? We created 2 new databases and added those entries in both tnsnames on the local pc, and the tnsnames on the application server. Able to connect via sqlplus, toad, etc. but not through forms developer. We are running 10g app server, 10g developer suite, 10g databases. Any ideas?
    Thanks,
    Deb

  • UNABLE TO CONNECT TO THE DATABASE

    Problem Description:
    Unable to connect to the database:
    http://192.168.1.94:1158/dva/mac/login
    Login to Database:
    * User Name : dvowner
    * Password : XXXXXXXXXXX
    Login Error
    TNS:listener does not currently know of service requested in connect descriptor [12514].

    How does your inquiry related to Audit Vault?
    The 12514 error you are reporting is one of the most common and addressed at great length at metalink.

  • Unable to connect to the database to product shared services

    Hi
    I got an error in configuring shared services with the Oracle server database
    "" Unable to connect to the database to product shared services ""
    I created a database that is working properly when accessed by a client.
    I typed everything in config utility, Does we need to take care of any other servies?
    I appreciate if any one help with this.
    Thanks
    Abel Junior
    Version: Hyperion System 9 and Oracle 9i

    John is of course correct that XP is not a supported environment for Essbase 9.3.x.
    Having said that, I have successfully installed Shared Services, Essbase, and EAS on multiple XP laptops. I have done so with 9.2 (painful) and 9.3.1 (just about painless) although always against SQL Server. This is strictly for development/kick the tires work, never as a production environment.
    Planning has quite an issue with XP (and Vista) although I have heard that there is a Windows Registry fix for this.
    Of course Oracle support is going to gong you if you call up with questions about your laptop -- it isn't supported.
    One last thing -- Shared Services and laptop suspends =! stability. For my development purposes, I have backed off Shared Serivces and just go with Essbase as a service with native security and EAS.
    Regards,
    Cameron Lackpour
    P.S. VMs are probably the way to go if your desktop/laptop has the horsepower to drive a proper OS with the VM overhead. On a 4 gigabyte laptop with a Duo Core (no, not a Mac, I just can't remember what Intel calls it -- the power of marketing) VMServer running Windows Server 2003 and the full stack is pretty slow, but it works.

  • "Unable to connect to the database" when connected to corporate network

    Hi
    Installed Primavera P6 V7 and Oracle 10g in Stand alone on XP 32bit machines with SP3. When our machines are NOT connected to the corporate network it works fine.
    However when connected to the network we can not access the locally stored database. We get message "primavera unable to connect to the database. would you like to configure the database connection now"
    Database on servers that we set up are fine regardless.
    If we connect machines to just the internet, again no issues.
    So something is stopping Primavera opening local database when connect on our corporate network.
    Any ideas please?
    Thanks

    This may be a long shot but look into how your TNSNAMES.ora file is being distributed on the domain (or are you possibly utilizing LDAP.ora on the domain side?).
    Some time ago I remember a company scripting an ENV variable on domain logon that altered where the Oracle client would pull the TNSNAMES from.

  • "unable to connect to the database. retrying"

    Hi,
    I have ZFD4 on a NW6 server, and have not had the required ammount of time
    to implement in full and work on it...
    However, It was installed a while ago, and was working fine and left
    running.
    I cannot get any Inventory/scan data from any of the workstation objects
    though. In Console 1, it tells me to Configure DB. If I try this, it gives
    the error cannot connect to DB.
    On the console, the Inventory service reports "unable to connect to the
    database. retrying..."
    How do I resolve this? The Sybase adaptive server anywhere 7.0.2.15 is up
    and running...
    HELP!
    TIA
    Alan

    Alan,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Do a search of our knowledgebase at http://support.novell.com/search/kb_index.jsp
    - Check all of the other support tools and options available at
    http://support.novell.com.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://support.novell.com/forums)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://support.novell.com/forums/faq_general.html
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • Unable to connect to specified database

    I am using Reports 6i as part of a iAS server.
    From my application I can request a report and have it produced
    and then try running it again and have it return the message
    REP-0501 Unable to connect to specified database. There is no
    pattern to when it works and when it doesn't. It does seem to
    fail more when you change to a different report but it will also
    happen if you try the same report.
    I've checked the tnsnames file and it correctly has the database
    information.
    It is also happening on a second server as well. Both are new
    installs. Both iAS servers are NT connected to a Unix database.
    Connection to the database is done by a name server and
    connections using SQLPLUS have no problem.
    Critical issue to user, any ideas?

    This is a bug and is fixed in 10.1.2.3. Bug#5691620
    Please refer to mealik Note 414057.1
    Thks
    Sharath

  • Unable to Connect to the database in RCU, Oracle11g XE on Laptop/Windows

    Software downloaded unzipped and installed from OTN
    OBIEE foundation 11.1.1.5
    Repository Creation Utility 11.1.1.5
    Oracle Database Express Edition 11.2
    Issues
    1. I installed Oracle 11g express edition. I am able to start/stop and run sql against the database however the homepage ("get started " accessed from Start > Programs > Oracle Database 11g XE > Get Started) does not work. This i will post in a separate thread but I am writing this anyway just in case it has some relevance.
    2, This is the one I need help with. Can you confirm that these are the parameters when I hit the "create" option in RCU because I get the error message saying I cannot connect.
    Hostname:This is the same as the hostname, when I go to cmd prompt like below
    C:>hostname<enter> That is what I am using.
    Port and Service :Can you confirm, Port = "1521" and Service = "XE". 1521 is the Database listener port when I installed Oracle 11g Database Express Edition. I am not putting the quotes in the boxes in the RCU.
    Should the service be OracleServiceXE - i have tried it but does not work.
    Anyway I get this message:
    Unable to connect to the database using the provided details.
    Please enter a valid hostname and port or check if the listener is up and running.
    Any ideas appreciated.
    By the way My lsnrctl status returns the following: (meaning the listeners are up!0
    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.
    C:\Documents and Settings\dir>lsnrctl status
    LSNRCTL for 32-bit Windows: Version 11.2.0.2.0 - Production on 13-MAR-2012 13:44
    :03
    Copyright (c) 1991, 2010, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
    STATUS of the LISTENER
    Alias LISTENER
    Version TNSLSNR for 32-bit Windows: Version 11.2.0.2.0 - Produ
    ction
    Start Date 13-MAR-2012 10:55:11
    Uptime 0 days 2 hr. 48 min. 51 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Default Service XE
    Listener Parameter File C:\oraclexe\app\oracle\product\11.2.0\server\network\a
    dmin\listener.ora
    Listener Log File C:\oraclexe\app\oracle\diag\tnslsnr\myspecifichostname\listene
    r\alert\log.xml
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=myspecifichostname)(PORT=1521)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=myspecifichostname)(PORT=8080)))
    Services Summary...
    Service "CLRExtProc" has 1 instance(s).
    Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Edited by: ideakat on Mar 13, 2012 1:57 PM

    Hi,
    Like Abhi said, check your tnsnames.ora file to check the port number and service name is correct or not for the Express Edition database you have installed.
    and when you are running RCU installer, Please give system adminstrator account of OracleXE like 'sys' or 'system' account with confirmed port number and service name.
    Hope this helps.
    Regards,
    Bose
    Edited by: Bose on Mar 16, 2012 11:42 AM
    Edited by: Bose on Mar 16, 2012 5:35 PM

  • Unable to connect to MySQL Database using MX

    I am unable to connect to MySQL database hosted on a remote
    server. I get the following error message:
    "HTTP Error Code 404 File Not Found. Here are some possible
    reason for the problem:
    1) There is no testing server running on the server machine.
    2) The testing server specified for this site does not map to
    the
    http://72.9.255.2/~keyitems/_mmServerScripts/MMHTTPDB.php
    URL. Verify that the URL Prefix maps to the root of the site."
    I have specified a testing server. My url is "
    http://72.9.255.2/~keyitems/........."
    For the URL prefix to the site's root folder, I listed the
    following:
    1.
    http://72.9.255.2/~keyitems/
    this did not work. I got the above error message.
    2.
    http://72.9.255.2/ this did not work
    also. I got the above error message.
    Any input would be great as I do not know where to start !!!
    Thank you

    Hi Ravi
    Glad to hear you solved this. It is very gratifying when one solves it alone, don't you think?
    Best wishes
    Michael

  • Application cannot proceed. Internal error occured. Contact your administrator. Error msg: Unable to connect to the database. Please make sure the database information specified in admin/includes/config.php are correct.

    After clicking in email link, I get the following message on Firefox page : " The application cannot proceed!
    An internal error occured. Please contact your administrator and describe the steps you took before you encounter this error message.Error msg: Unable to connect to the database. Please make sure the database information specified in admin/includes/config.php are correct."
    The email asked to install the latest Adobe Flashplayer version to have it working. I installed it, also updated my plug-ins and checked in safe mode that the extensions were not the problem. I also deleted the cookies an cache. Nothing seems to be working so far. I have the lastest version of Firefox 8.0.1 as well as Roboform 7. I noticed that the latest Firefox version has (x86) tagged to it. Does it refers to an 86 bits because my computer uses 32 or 64 bits only. I tried also different browsers and the message kept appearing. How do I resolve this problem?

    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    * Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    * Tools > Options > Privacy > Cookies: "Show Cookies"

  • INS0009: Unable to connect to the database with user SYS

    Hi all,
    I'm trying to create an OWB repository with OWB repository assistant (10.2.0.2.) on a 10.2.0.1. database (windows XP platform). I get the following error every time I fill in the connect info for the SYS user:
    INS0009: Unable to connect to the database with user SYS. java.sql.SQLException: ORA-01017: invalid username/password; logon denied
    I can connect to the database (sqlplus sys/<password>@orcl as sysdba) and the OS user is in the ora_dba group. Also checked the database parameters remote_login_passwordfile (= EXCLUSIVE) and O7_DICTIONARY_ACCESSIBILITY=TRUE.
    Does anyone know what the problem is? Any help is appreciated.
    Regards,
    Quinten

    Ok I found the problem myself, I used the wrong sys password :-(. I thought the password I used to logon in sqlplus was right (sqlplus sys/<password>@orcl as sysdba) but the password doesn't matter when you logon as sysdba! So I altered the password for the user sys and now I can continue the steps of the repository assistant.
    Quinten

  • Unable to connect to the database through OEM

    Hi,
    ORACLE VERSION: 10.2.0.1.0
    OPERATING SYSTEM:LINUX
    I was unable to connect to my database through OEM.It is showing error like this in my OEM .
    Enterprise Manager is not able to connect to the database instance. The state of the components are listed below.
    The below is the list of errors written in the trace file .
    2009-07-13 14:55:18,351 [EMUI_14_55_18_/console/aboutApplication] ERROR em.console doGet.311 - java.lang.IllegalStateException: Response has already been committed
    java.lang.IllegalStateException: Response has already been committed
         at com.evermind.server.http.EvermindHttpServletResponse.resetBuffer(EvermindHttpServletResponse.java:1901)
         at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:211)
         at oracle.sysman.emSDK.svlt.PageHandler.render(PageHandler.java:773)
         at oracle.sysman.emSDK.svlt.PageHandler.handleRequest(PageHandler.java:396)
         at oracle.sysman.emSDK.svlt.EMServlet.myDoGet(EMServlet.java:688)
         at oracle.sysman.emSDK.svlt.EMServlet.doGet(EMServlet.java:291)
         at oracle.sysman.eml.app.Console.doGet(Console.java:135)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
         at oracle.sysman.emSDK.svlt.EMRedirectFilter.doFilter(EMRedirectFilter.java:101)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
         at oracle.sysman.db.adm.inst.HandleRepDownFilter.doFilter(HandleRepDownFilter.java:123)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
         at oracle.sysman.eml.app.ContextInitFilter.doFilter(ContextInitFilter.java:239)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:600)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:793)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    2009-07-13 14:55:20,893 [HttpRequestHandler-25640626] ERROR conn.ConnectionService verifyRepositoryEx.433 - Invalid Connection Pool. ERROR = ORA-01017: invalid username/password; logon denied
    2009-07-13 14:55:20,925 [HttpRequestHandler-25640626] ERROR eml.OMSHandshake getParameterFromDB.402 - ORA-01017: invalid username/password; logon denied
    2009-07-13 14:55:20,926 [HttpRequestHandler-25640626] ERROR eml.OMSHandshake processFailure.619 - OMSHandshake failed.(AGENT URL = http://VTL3200DB:3938/emd/main)(ERROR = INTERNAL_ERROR)
    2009-07-13 14:55:20,959 [HttpRequestHandler-23946437] ERROR conn.ConnectionService verifyRepositoryEx.433 - Invalid Connection Pool. ERROR = ORA-01017: invalid username/password; logon denied
    2009-07-13 14:55:20,990 [HttpRequestHandler-23946437] ERROR eml.OMSHandshake getParameterFromDB.402 - ORA-01017: invalid username/password; logon denied
    2009-07-13 14:55:20,991 [HttpRequestHandler-23946437] ERROR eml.OMSHandshake processFailure.619 - OMSHandshake failed.(AGENT URL = http://VTL3200DB:3938/emd/main)(ERROR = INTERNAL_ERROR)
    2009-07-13 14:55:42,047 [OmsServiceDriver thread] ERROR conn.ConnectionService verifyRepositoryEx.433 - Invalid Connection Pool. ERROR = ORA-01017: invalid username/password; logon denied
    2009-07-13 14:55:51,030 [HttpRequestHandler-12767107] ERROR conn.ConnectionService verifyRepositoryEx.433 - Invalid Connection Pool. ERROR = ORA-01017: invalid username/password; logon denied
    2009-07-13 14:55:51,062 [HttpRequestHandler-12767107] ERROR eml.OMSHandshake getParameterFromDB.402 - ORA-01017: invalid username/password; logon denied
    2009-07-13 14:55:51,063 [HttpRequestHandler-12767107] ERROR eml.OMSHandshake processFailure.619 - OMSHandshake failed.(AGENT URL = http://VTL3200DB:3938/emd/main)(ERROR = INTERNAL_ERROR)
    2009-07-13 14:55:51,096 [HttpRequestHandler-28346522] ERROR conn.ConnectionService verifyRepositoryEx.433 - Invalid Connection Pool. ERROR = ORA-01017: invalid username/password; logon denied
    2009-07-13 14:55:51,127 [HttpRequestHandler-28346522] ERROR eml.OMSHandshake getParameterFromDB.402 - ORA-01017: invalid username/password; logon denied
    2009-07-13 14:55:51,127 [HttpRequestHandler-28346522] ERROR eml.OMSHandshake processFailure.619 - OMSHandshake failed.(AGENT URL = http://VTL3200DB:3938/emd/main)(ERROR = INTERNAL_ERROR)
    2009-07-13 14:56:21,162 [HttpRequestHandler-32110028] ERROR conn.ConnectionService verifyRepositoryEx.433 - Invalid Connection Pool. ERROR = ORA-01017: invalid username/password; logon denied
    2009-07-13 14:56:21,193 [HttpRequestHandler-32110028] ERROR eml.OMSHandshake getParameterFromDB.402 - ORA-01017: invalid username/password; logon denied
    2009-07-13 14:56:21,194 [HttpRequestHandler-32110028] ERROR eml.OMSHandshake processFailure.619 - OMSHandshake failed.(AGENT URL = http://VTL3200DB:3938/emd/main)(ERROR = INTERNAL_ERROR)
    2009-07-13 14:56:21,227 [HttpRequestHandler-12767107] ERROR conn.ConnectionService verifyRepositoryEx.433 - Invalid Connection Pool. ERROR = ORA-01017: invalid username/password; logon denied
    2009-07-13 14:56:21,258 [HttpRequestHandler-12767107] ERROR eml.OMSHandshake getParameterFromDB.402 - ORA-01017: invalid username/password; logon denied
    2009-07-13 14:56:21,259 [HttpRequestHandler-12767107] ERROR eml.OMSHandshake processFailure.619 - OMSHandshake failed.(AGENT URL = http://VTL3200DB:3938/emd/main)(ERROR = INTERNAL_ERROR)

    Invalid Connection Pool. ERROR = ORA-01017: invalid username/password; logon denied
    Don't say password is correct, if password is correct then tell us what last changes you did. did you change SYSMAN password throught alter user ...identified ... ?
    Regards,
    Taj

  • Unable to connect to a database

    Hello
    I am trying to connect to a database, but it comes up with an error message. the code is shown below.
    Error is as shown below
    init:
    deps-jar:
    Compiling 1 source file to C:\Documents and Settings\prozario\AssetManage\build\classes
    compile-single:
    run-single:
    Exception in thread "main" java.lang.NullPointerException
    at assetmanage.DBConnectionManager.createStatement(DBConnectionManager.java:37)
    at assetmanage.Main.main(Main.java:36)
    Unable to connect to database java.sql.SQLException: No suitable driver
    Java Result: 1
    BUILD SUCCESSFUL (total time: 1 second)
    //////////////////////////////////////////////////THE CODE////////////////////////
    package assetmanage;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.sql.Statement;
    public class DBConnectionManager {
    Connection dbConnect;
    Statement dbStatement;
    public void loadDriver(){
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    } catch (ClassNotFoundException e){System.out.print("Unable to load driver" + e);
    public void connectDB(){
    try{
    String dbName = "userInfo.mdb";
    String url = "jdbc:odbc" + dbName;
    Connection dbConnect = DriverManager.getConnection(url);
    } catch (Exception e){System.out.print("Unable to connect to database " + e);
    public void createStatement(){
    try{
    Statement dbStatement = dbConnect.createStatement();
    }catch (SQLException sqle){System.out.println("Unable to create statement" + sqle);
    public void createTable(){
    String creaTable = "CREATE TABLE tblPINCODE (PINCODE INT NOT NULL)";
    try{
    dbStatement.executeUpdate(creaTable);
    }catch (Exception e){System.out.print("Unable to create table " + e);
    Can anyone help please?

A: Unable to connect to a database

This works well for me to connect to a Microsoft Access Database. Perhaps it will help. I always appreciated getting some actual help rather than cryptic "don't you know what you're doing, go look" comments. If I knew what I was doing wrong I wouldn't be posting. Therefore, I hope this is helpful and not cryptic!!
This works well for an MS Access Database.
import java.sql.*;
import java.io.*;
public class DBConnection
private static Connection con = null;
public static void setConnection(String path) throws SQLException
DriverManager.registerDriver (new sun.jdbc.odbc.JdbcOdbcDriver());
String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
database+= path.trim() + ";DriverID=22;READONLY=true}"; // add on to the end
File file = new File(path);
if (!file.exists())
throw new SQLException ("\nFile \"" + path + "\" not found");
con = DriverManager.getConnection(database);
public static Connection getConnection()
return con;
public static void closeConnection()
try
con.close();
catch (SQLException x)
System.out.println("Error: " + x);
// This now is a call from any class to the DBConnection class above.
String filename = "F:/Your own Path.mdb";
DBConnection.setConnection(filename);
Connection conn = DBConnection.getConnection();
// Somewhere in your code, close the conn connection

This works well for me to connect to a Microsoft Access Database. Perhaps it will help. I always appreciated getting some actual help rather than cryptic "don't you know what you're doing, go look" comments. If I knew what I was doing wrong I wouldn't be posting. Therefore, I hope this is helpful and not cryptic!!
This works well for an MS Access Database.
import java.sql.*;
import java.io.*;
public class DBConnection
private static Connection con = null;
public static void setConnection(String path) throws SQLException
DriverManager.registerDriver (new sun.jdbc.odbc.JdbcOdbcDriver());
String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
database+= path.trim() + ";DriverID=22;READONLY=true}"; // add on to the end
File file = new File(path);
if (!file.exists())
throw new SQLException ("\nFile \"" + path + "\" not found");
con = DriverManager.getConnection(database);
public static Connection getConnection()
return con;
public static void closeConnection()
try
con.close();
catch (SQLException x)
System.out.println("Error: " + x);
// This now is a call from any class to the DBConnection class above.
String filename = "F:/Your own Path.mdb";
DBConnection.setConnection(filename);
Connection conn = DBConnection.getConnection();
// Somewhere in your code, close the conn connection

  • SOS Unable to Connect Report Server

    hi alll
    i have to present my project 9/1/2008 i have two days
    and i have three report
    i set all the details
    i set the name of the server RepSrv
    but at the run time
    this message apear
    Unable to connect Report Server
    should i write something in .DEV
    what should i do
    i work on 9i version
    i wrote this Simple Code
    report := RUN_REPORT_OBJECT('REPORT46');
    i set the property in the Property paletty
    NOT: when i try to run the Report in Report Developer
    the browser apear and send me the message
    "Cannot make crusor from "The name of the table""
    i think it is another problem
    please help
    this is my mail if you want to send me solution
    [email protected]
    please help
    thanks to all

    i write this Code
    and then the browser run and still run until now
    but it didn't apear any thing
    so .... any help in that
    Declare
         repid Report_Object;
    v_rep VARCHAR2(100);
    rep_status VARCHAR2(20);
    vjob_id varchar(100);
    BEGIN
    repid := find_report_object('REPORT51');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_EXECUTION_MODE,BATCH);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,CACHE);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'html');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,'repserver90');
    v_rep := RUN_REPORT_OBJECT(repid);
    rep_status := REPORT_OBJECT_STATUS(v_rep);
    vjob_id := substr(v_rep,length('repserver90')+2);
    WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
    Loop
    rep_status := report_object_status(v_rep);
    END LOOP;
    IF rep_status = 'FINISHED' THEN /*Display report in the browser*/
    WEB.SHOW_DOCUMENT('http://hiast-3ec7eef07:8888/reports/rwservlet/getjobid'||substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=repserver90','_blank');
    ELSE
    message('Error when running report');
    END IF;
    END;

  • Maybe you are looking for

    • HDMI is showing as No Signal on my LG television

      My HDMI cable worked perfectly well before my laptop (ACER TravelMate/P with Windows 8) automatically updated. My laptop now makes a sound when I connect it to the Television so I believe it has been recognised but my LG television says "No Signal".

    • How can I have my macbook completely exact to my iMac ?

      I am planning to buy a macbook pro, and I am going to use the migration so I have them exactly the same. But what I don't want to do in the future is having to download things twice, or copying and pasting everything I do... is there any way to have

    • How to attach documents to BPM workspace from IPM ?

      Hi All, I want to attach a document to BPM workspace, which is uploaded from Oracle IPM. I can create the BPM instance and pass the metadata form IPM to BPM workspace. Passing image URL to one of the field, also possible but i want to attach the docu

    • Save (not Save As) brings up file selector? Huh?

      Logic 7.1.1 I'm fine-tuning the way I want my Autoload song to appear. So I boot Logic and as expected the Autoload song automatically loads up. So far so good. I make a change to it and use the "Save" command, expecting that the old Autoload song wi

    • CUIC REPORT for 8.5

                         Dear Team Is there any way to get the SQL Queries for UCCE 8.5 and run it from Sql Server , also how we can get a report to calculate abandoned calls with percentage. Please advise we are face data calculation issue with exiting CU