[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.

Hi, I've seen questions about this error posted elsewhere but I'm not sure if the same issues applied.
I'm trying to connect to SQL Server from a VBA macro in excel. I've managed to do this with the code below where my query is return to cells in my active worksheet but for another query I want to run the data to be return is too large for Excel to handle
and so I'd like to save it as a .csv file but using the second example of my code I get the message "[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied". Since I have access to this database from the first example
of the code, I assume my conn.ConnectionString line of code is letting me down.
Can anyone help me please?
'Code to return data to worksheet'
Sub macro2()
With ActiveSheet.ListObjects.Add(SourceType:=0, Source:=Array(Array( _
        "ODBC;DSN=SQLRA - OPENBET;UID=user1;Trusted_Connection=Yes;APP=Microsoft Office 2013;WSID=pdfdf3001;DATABASE=open;Network=DBMSS" _
        ), Array("OCN;Address=SQLRA_DB,55455;ApplicationIntent=READONLY;")), _
        Destination:=Range("$BG$1")).QueryTable
        .CommandText = Array( _
        "select  A.ev_oc_id, B.ev_mkt_id, A.ev_id, D.start_Time, Upper(Replace(A.[desc],'|','')) , A.result, COALESCE(A.sp_num, A.lp_num) , ", _
        "COALESCE(A.sp_Den, A.lp_Den) from open.reporting.tevoc A, open.reporting.tevmkt B, open.reporting.tevocgrp C, open.reporting.tev D ", _
        "where  A.ev_mkt_id = B.ev_mkt_id and B.ev_oc_grp_id = C.ev_oc_grp_id and D.ev_id = A.ev_id and Upper(Replace(D.[desc],'|','')) = 'home' and upper(B.name) = '|today|' and D.ev_type_id in (264, 289) and D.ev_class_id = 49
and D.start>= '" & Year & "-" & Month & "-" & Day & "'" _
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = True
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .PreserveColumnInfo = True
        .ListObject.DisplayName = "Table_Query_from_SQLRA___OPEN_1"
        .Refresh BackgroundQuery:=False
    End With
End Sub
'Code that produces error'
Sub macro1()
Dim conn As ADODB.Connection
Set conn = New ADODB.Connection
Dim testSQL As String
Dim qd As DAO.QueryDef
Dim openbetdb As Database
    conn.ConnectionString = "driver={SQL Server}; server= sqlra_db;uid=user1;APP=Microsoft Office 2013;WSID=pdfdf3001;database=openbet"
    conn.Open
    testSQL = "SELECT * FROM open.reporting.TevType where ev_class_id = 49 and ev_type_id in(289,330,518,13492);"
    Set qd = Db.CreateQueryDef("tmpExport", testSQL)
    DoCmd.TransferText acExportDelim, , "tmpExport", "C:\\export.csv"
End Sub

Hello,
Are you connect to remote SQL Server? If so,
please make sure the target SQL Server is running and is listening on appropriate protocols. Please take a look at the following article about general steps to troubleshoot
SQL connectivity issues:
http://blogs.msdn.com/b/sql_protocols/archive/2008/04/30/steps-to-troubleshoot-connectivity-issues.aspx
Regards,
Elvis Long
TechNet Community Support

Similar Messages

  • OLE DB or ODBC error: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied

    Hi,
    I have one client and one server.  In both hosts I created an OS-user named User1.
    The user have been given various role under the prefix SQLServer2005.
    The default instance of SQL Server and instance (background-process) of
    Analysis Service are also run under User1.
    I connected via Management Studio to Analysis Service directly in the
    server.  I set the permission to access Analysis Service to Everyone. 
    This means everyone should be able to use Analysis Service.  I have set
    ODBC data source to the server.  Testing was successful.
    I created a project to create a cube.  The tables are fairly small (total 300 MB, biggest one 290).
    On project setting (created at client) I set the server host as
    deployment target. I managed to deploy project when all I have are Data
    Source and Data Source Views.
    But on deployment I always failed.   The errors remain the same, begins with
    OLE DB error: OLE DB or ODBC error: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.; 08001.
    I have tried 4 combinations of Impersonation :
    (A) Use a specific username and password
      * in which I supply User1 and the password of User1
    (B) Use the service account
    (C) Use the credentials of the current user
    (D) Default
    Why is this? The server does certainly exist.  I think the error message is wrong.
    I have seen 3 posting that seems related.  One of them say the solution is giving the right impersonation, but gave no detail.  About the privilege, User1 are granted the role of
    SQLServer2005MSOLAP.  What is the solution?
    Thank you,
    Bernaridho

    I just had this problem and solved it by creating an alias in SQL Server Configuration Manager, as below:
    Scenario: My SQL server is accessible from the internet under my.domain.com, and from itself at ServerName. But the local network can't see itself through the router at my.domain.com, so the deployed project is unable to process the cube, since that would
    require Analysis Services to be able to see the SQL Server at my.domain.com, which it can't do.
    So I changed the server in my project from my.domain.com to ServerName, and I created a local alias to ServerName in SQL Server Configuration Manager, under SQL Native Client 11.0 Configuration, Aliases. In my case, I pointed it to localhost port 1333, and
    used SSH -L 1333:my.domain.com:1433, but I could have pointed the alias directly to the server, just as well. (Verifying... yes, that worked too, so you can forget SSH if you have no interest in it.)

  • Can't Create a Data Source - Failed to test connection. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied

    Hi there,
    I am having a serious issue with The Power BI Data Management Gateway which I am hoping that someone can help me with.
    Basically I am setting a connection between a Power BI demo site and a SQL 2012 Database based on Azure. The Data Management Gateway and is up and running, and Power BI has managed to connect to it successfuly.
    By following the tutorials at
    here I was able to successful create my Data Connection Gateway with a self-signed certificate.
    However, when trying to create the data source I come into problems. The Data Source Manager manages to successfully resolve the hostname, as per the screenshot below:
    Bear in mind that I exposed the require ports in Azure as endpoints and I managed to modify my hosts file on my local machine so I could access the SQL server hosted in Azure using its internal name -- otherwise I would not be able to get this far.
    However the creation of the data source also fails when trying to created it whilst logged in the SQL server in question:
    The Data Source Manager returns the error when using the Microsoft OLE DB Provider for SQL Server:
    Failed to test connection. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied
    I tried using the SQL Server Native Client 11.0 instead but I also get an error. This time the error is:
    Failed to test connection. Login timeout expiredA network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.Named Pipes Provider: Could not open a connection to SQL Server [53]. 
    Some considerations
    If I provide an invalid username/password, the Data Source Manager does say that the username and password is incorrect.
    Firewall is turned off in the SQL Server (either way, this error also happens if I try top use the Data Source Manager whilst logged in the SQL Server itself).
    SQL Profiler does not show any attempt of connection.
    The SQL server instance in question is the default one.
    The error happens regardless if I select the option to encrypt connection or not.
    In SQL Configuration manager I can see that all protocols are enabled (TCP/IP, Named Pipes and Shared Memory.
    The Event Viewer does not provide any further errors than the one I have copied in this post.
    I'm at a loss here. Could someone please advise what might I be doing wrong?
    Regards,
    P.

    Here is what I had to do to solve this issue:
    Basically I had to add the MSSQL TCP/IP port as an end-point in Azure. After I did that, then I was able to create the data-source. However, I was only able to authenticate with a SQL account, as any domain account would return me an error saying that the
    domain isn't trusted.
    What puzzles me here is how come the Data Source Manager would inform me that an account username/password was invalid, but it would fail/timeout if I provided valid credentials (!?!?!!?)

  • [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

    I using SQL 2000 on Server 2012 in named instance. when i connect locally, it's ok, but when try to connect from network it generates error [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

    Hi Sayed Abdul Latif,
    As other post, SQL Server 2000 was out of support since April,2013. You can try to install SQL Server 2005 or later version. In addition, since the issue regards SQL Server Data Access. I will help you post the question in the related forums. It is appropriate
    and more experts will assist you.
    According to your description, you can only connect to SQL Server locally, I recommend you check if the TCP/IP and Named Pipes are enabled in SQL Server Configuration Manager. And the SQL Server is set to allow remote connection. Then restart the SQL Service
    and check if you can connect to SQL Server remotely.
    Additionally, we also need to verify if the SQL Server named instance is in a cluster, and connect to it by using the "servername\instancename" syntax, then you receive the above error message. If yes, you have to hardcode the TCP port or the Named Pipe
    of the SQL Server named instance. For more information, you can review the following article.http://support.microsoft.com/kb/888228/en-us
    Thanks,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • SQL Server does not exist or access denied - periodic error

    Hi There,
    For the last week or so, I have been getting periodic errors on my sites powered by MSSQL databases. The error message is as follows:
    Microsoft OLE DB Provider for SQL Server error '80004005'
    [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
    Usually, a quick refresh, and everything works fine again.
    My host doesn't know what has caused the issue, but has dug up this microsoft link: http://support.microsoft.com/kb/907264
    Most of that tech speak is beyond me! I use Dreamweaver - does anybody know if the standard dreamweaver connections or cursors contravene the advice on that page, and if so how to fix it?
    If not, does anybody know where to look to solve this issue?
    Thanks,
    Dan 

    I had this same problem and on a hunch I deleted the brackets
    so that the connection string instead of being,
    "Persist Security Info=False;Data
    Source=[THESERVER\SQLEXPRESS];Initial Catalog=[AdventureWorks];User
    ID=[ATEST];Password=[kjdkjdkjd]"
    is now,
    "Persist Security Info=False;Data
    Source=THESERVER\SQLEXPRESS;Initial Catalog=AdventureWorks;User
    ID=ATEST;Password=kjdkjdkjd"
    This was in Dreamweaver 8.

  • "server does not exist or access denied"

    On a particular family-oriented website, I keep getting this message when I try to access the site:
    Microsoft OLE DB Provider for ODBC Drivers error '80004005'
    [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.
    /Include/ADOHelper.asp, line 137
    No idea why, been there before, and this isn't a site anyone would have a reason to restrict. Any ideas would be helpful.

    First see if SQLServer is up and running
    Go to start-> run in machine where sql is installed and type services.msc
    In services list check if SQLServer service is present and is running. If not started, start it and make start mode as Automatic
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • SQL Server does not exist or access denied.

    Hello all,
    I am having a really frustrating time with our servers....
    once a week, the cold fusion server can't (or won't) connect
    to our separate MS-SQL server. It reports back an error that the
    connection could not be found or is denied. Our servers are running
    Windows 2000 Server and have the latest SP installed.
    To fix the problem, I just restart coldfusion and that's it.
    I have searched google groups and these forums but have not found
    any real solution. Can someone help??
    Thank you!!

    Perhaps you have some investigating to do the next time this
    occurs?
    Have you tried any of these...
    * Go to CF Admin and verify the datasource
    * Delete and recreate datasource
    * Try to create a new datasource
    * Try to ping SQL Server from CF server
    Also, in general, you should consider not using ODBC.
    Good luck!

  • Connection failed: SQLState:'01000' SQL Server Error:67 [Microsoft]ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()). Connection failed: SQLState:'08001' SQL Server Error:17 [Microsoft]ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist o

    Help,
    setup a new sql server 2012 on a windows 2012r2 server to replace old sql server 2005 on an old windows server 2003 machine.  When i test the ODBC connection locally on the server it works fine, however when i try to connect via windows 7 client machine
    i get the following error:
    Connection failed:
    SQLState:'01000'
    SQL Server Error:67
    [Microsoft]ODBC SQL Server Driver][DBNETLIB]ConnectionOpen
    (Connect()).
    Connection failed:
    SQLState:'08001'
    SQL Server Error:17
    [Microsoft]ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied
    I think it must be a permissions thing, I've turned off the firewall for now and still no difference, 've also made sure remote connection is enabled.  I can connect to the other sql server in studio manager on the new machine however, i can't go do
    the same in the old server, says:
    cannot connect to hbfsqlpro1\hbfsqlpro1
    Additonal information a network related or instance specifc error occured while establising a connection to SQL server.  The server was not found or was not accessible.  Verify that the instance name is correct and that SQL server is configured to
    allow remote connections. (provider:SQL Network Interfaces, error 26 - error locationg server/instance specified) (Microsoft SQL server)
    the instance is def correct, as that is what i use to connect locally on the new machine and what it comes up on the studio manager on the new machine.  STarting to pull my hair out somewhat, i'm sure it's something really simple! 

    Hello,
    You are trying to connect to a named instance. Make sure the SQL Server Browser service is started on the SQL Server computer.
    Make sure TCP/IP is enabled.
    http://msdn.microsoft.com/en-us/library/ms191294(v=sql.110).aspx
    Try to disable Windows Firewall or security software on both, SQL Server instance and client computer.
    Test basic connectivity too. Try to ping from the client computer to the SQL Server computer.
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Sql server does not exist or access is denied.

    Hi,
    i am trying to connect a dadabase to the server from client pc. and i take the sql error  [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied to the client pc.
    i using .udl file and ia trying to connect with sql authentication.
    please advice.

    the clients computers are in the workgroup network.
    Hi Antonia,
    Please ensure you specify the correct server name, and check SQL Serer instance was started.
    A good article about UDL connect to SQL DB for your reference, please see:
    Quick Database Connectivity Testing:
    http://sqlblog.com/blogs/andy_leonard/archive/2011/08/26/quick-database-connectivity-testing.aspx
    In addition, this issue also might be caused by the windows fire setting. Please also take a look at the following article regarding configure the Windows Firewall to allow SQL Server Access:
    http://technet.microsoft.com/en-us/library/cc646023(v=sql.110).aspx
    Reards,
    Elvis Long
    TechNet Community Support

  • The list of workflow actions on the server references an assembly that does not exist

    Hi,
    This issue has been discussed many times in this forum , the reason why I am posting is I tried the resolution steps but I dont see any luck.
    I am getting the below message from the SharePoint designer 2007 when I am trying to modify a workflow
    "This list of workflow actions on the server references an assembly that does not exist. Some actions will not be available. The assembly strong name is Microsoft.SharePoint.WorkflowActions, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c.
    Contact your server administrator for more information."
    #1 : One of the post says "Normally you would see that error because someone has extended the Workflow actions available in SPD with a custom action developed in Visual Studio.  These custom actions are loaded when your workstation reads the WSS.ACTIONS
    file on the server.  The file is located in the 12 hive under Template\1033\workflow.  Your WSS.Actions file contains a reference to a custom action .dll which is not available on the server."
    I opened the WSS.Actions file in notepad, I dont see any line with *.dll in it. Am I missing something?
    #2: Another post says "The solution I discovered was that the server running my SharePoint Services was not up to .NET 3.0.  As soon as I updated to .NET 3.0 everything worked.I had made sure the machine running SharePoint Designer was updated, but
    had missed the SHarePoint Services server."
    The server is already updated to .Net 3.0.
    #3: I went to the %System Drive%\Documents and Settings\Local Settings\ApplicationData\Microsoft\SharePointDesigner.
    Deleted the ProxyAssemblyCache folder but no luck.
    Just checking if any one was able to resolve this issue by following any of the solution other than the above mentioned ones.
    Thanks,
    Cutloo

        I have the similar issue with my custom work flow. I have searched the whole day for the solution but no success, then at last a simple track works for me. Please try this if any one faces such issue.
    Basically the assembly that we have define in the ACTIONS file dose not exists on the server, because of two reasons, either we have given the wrong assembly name (in our case the namespace name inside our solution) or the PublicKeyToken may differ from the
    original assembly, that are deployed in GAC.
        So cross check both of these, in my case the assembly name was fine,
     <Action
        Name="Move Item to Another List and Send Email"
        ClassName="MyAssemblyName.Classname"
        Assembly="MyAssemblyName,Version=1.0.0.0, Culture=neutral, PublicKeyToken=4053d1fde8a1c781"
        AppliesTo="all"
        Category="Email actions">
    But the problem was in the 'PublicKeyToken', so i double click on the feature inside my solution,then in the bottom i have clicked on the manifest tab to check the entries.
    <Feature xmlns="http://schemas.microsoft.com/sharepoint/" Title="MyAssemblyName Feature1" Id="f7f1bda0-5f65-40f1-a705-f6f15a41da3a" ReceiverAssembly="MyAssemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0c32dbb769ed64b5"
    ReceiverClass="MyAssemblyName.Features.Feature1.Feature1EventReceiver" Scope="WebApplication"></Feature>
    Here i got the actual PublicKeyToken for my assembly (0c32dbb769ed64b5), i have replaced this number inside ACTIONS file, deploy the soultion, reset IIS.
    It works for me,

  • PL/SQL: ORA-00942: table or view does not exist

    Hi
    i have logged into my schema and trying to access the database "DAD" which has the table name "SCHOOL"
    i wrote a function which should give me new_sno when i give it the old_sno
    and i have this errors , pls help
    CREATE OR REPLACE FUNCTION ORIG_SN(OSNO in Number,OTN in Number)
    RETURN Number IS
    NEW_SNO Number:=0;
    BEGIN
    SELECT new_sno AS NEW_SNO
    FROM DAD.SCHOOL
    WHERE ORIG_SNO = OSNO AND ORIG_TN = OTN;
    RETURN NEW_SNO;
    END ORIG_SN;
    Warning: Function created with compilation errors.
    Errors for FUNCTION ORIG_SN:
    LINE/COL ERROR
    5/1 PL/SQL: SQL Statement ignored
    6/15 PL/SQL: ORA-00942: table or view does not exist
    Thanks in advance ..

    Try this,
    CREATE VIEW SCHOOL_VIEW AS SELECT * FROM DAD.SCHOOL;and then change your function like
    CREATE OR REPLACE FUNCTION ORIG_SN(OSNO in Number,OTN in Number)
    RETURN Number IS
    my_new_sno Number:=0;
    BEGIN
    SELECT new_sno INTO my_new_sno FROM SCHOOL_VIEW WHERE ORIG_SNO = OSNO AND ORIG_TN = OTN;
    RETURN my_new_sno;
    END ORIG_SN;and see if it is getting created without any errors.
    -Arun
    Edited by: Arunkumar Ramamoorthy on Aug 15, 2009 1:56 AM

  • Error(20,22): PL/SQL: ORA-00942: table or view does not exist

    I am getting currently getting an error when I try and insert into a table from a different schema from my Stored Procedure:
    Error(20,22): PL/SQL: ORA-00942: table or view does not exist
    I am explicitly calling the table with the schema name infront i.e.
    INSERT INTO SAPSR3.ZTREC_NAME_TYPE
    MASTER_ID,
    NAME_TYPE,
    FAMILY_NAME,
    FIRST_NAME,
    MIDDLE_NAME,
    TITLE
    VALUES
    In_MasterID,
    In_NameType,
    In_FamilyName,
    In_FirstName,
    In_MiddleName,
    In_Title
    I only get this error when I try and compile my stored procedure. If I try this insert not within a stored procedure (i.e. a blank script) it works perfectly.
    Can anyone tell me what Im doing wrong?
    Thanks.

    Hi,
    It sounds like you (the procedure owner) have privileges on that table only through a role.
    Roles don't count in stored procedures created with AUTHID OWNER (which is the default).
    Either
    (1) Have user SAPSR3 grant the necessary privileges directly to you (or to PUBLIC), or
    (2) change the procedure so that it runs with the caller's privileges, by adding AUTHID CURRENT_USER after the argument list but before the keyword IS (os AS) like this:
    CREATE OR REPLACE PROCEDURE     foo
    (     x     IN     NUMBER
    AUTHID CURRENT_USER
    IS ...

  • Hi i am getting an error like this while installing Live Cycle Server " The file merge_modules\lc11_common_iam_zip does not exist This file is required sucessfullly run the  Live Cycle Installer.Can any one help me on resolving this issue it would be of g

    Hi i am getting an error like this while installing Live Cycle Server " The file merge_modules\lc11_common_iam_zip does not exist This file is required sucessfullly run the  Live Cycle Installer.Can any one help me on resolving this issue it would be of great help..thanks .

    I think in your situation it would be worth trying the things listed under the event. It does have to do with FRS and it's easy to do. I've used it to fix journal errors after a server unexpectedly restarts and sysvol stops replicating.  I
    could see where it could fix your issue, and if it doesn't, you're out 5 minutes. :)
    The listed registry key does not exist
    Expand HKEY_LOCAL_MACHINE. 
    Click down the key path: 
       "System\CurrentControlSet\Services\NtFrs\Parameters" 
    Double click on the value name 
       "Enable Journal Wrap Automatic Restore" 
     

  • Java.sql.SQLException: ORA-01006: bind variable does not exist

    The java code is given below...
    /*UPDATE D9T652_DISBRSMNT_PRMTR
                        SET
                             Stmnt_Page_Wgt_Ozs = wtStatementStockSheet,
                        Chk_Page_Wgt_Ozs = wtCheckStockSheet,
                        Flat_Envelope_Wgt_Ozs = wtFlatEnv,
                        Half_Fold_Envelope_Wgt_Ozs = wtHalfFoldEnv,
                        Last_Chngd_By = TRIM(userId),
                        Last_Chngd_Dt = sysdate
                        WHERE
                             Ins_Sys_Id = Ins_Sys_Id_Constant_For_Compass AND
                             Last_Chngd_Dt = SELECT MAX(Last_Chngd_Dt)
              FROM D9T652_DISBRSMNT_PRMTR
              WHERE Ins_Sys_Id = Ins_Sys_Id_Constant_For_Compass
    updateDbPmtr= new StringBuffer(" UPDATE ")
    .append(SqlConst.PARAM)
    .append(" SET ")
    .append(SqlConst.PARAM).append(".").append(SqlConst.PARAM_DSBRSMNT_PRMTR_ID).append(" = 100, ")
    .append(SqlConst.PARAM).append(".").append(SqlConst.PARAM_MIN_DSBRSMNT_AMT).append(" = ? ").append(",")
    .append(SqlConst.PARAM).append(".").append(SqlConst.PARAM_OVRRD_MIN_DSBRSMNT_DT).append(" = ").append(currentTimeStamp).append(",")
    .append(SqlConst.PARAM).append(".").append(SqlConst.PARAM_SPCL_HNDLG_AMT).append(" = ? ").append(", ")
    .append(SqlConst.PARAM).append(".").append(SqlConst.PARAM_STMNT_DT).append(" = ").append(currentTimeStamp).append(" , ")
    .append(SqlConst.PARAM).append(".").append(SqlConst.PARAM_LAST_CHNGD_BY).append(" ='?' ").append(" , ")
    .append(SqlConst.PARAM).append(".").append(SqlConst.PARAM_LAST_CHNGD_DT).append(" = ").append(currentTimeStamp)
    .append(" WHERE ")
    .append(SqlConst.PARAM).append(".").append(SqlConst.PARAM_INS_SYS_ID).append(" = ? ")
    .append(" AND ")
    .append(SqlConst.PARAM).append(".").append(SqlConst.PARAM_LAST_CHNGD_DT)
    .append(" = ")
    .append(" ( SELECT ")
    .append(" MAX( ").append(SqlConst.PARAM_LAST_CHNGD_DT).append(" ) ")
    .append(" FROM ").append(SqlConst.PARAM)
    .append(" WHERE ")
    .append(SqlConst.PARAM_INS_SYS_ID).append(" = ? )").toString();
    conn = SqlUtil.getConnection();
    conn.setAutoCommit(false);     
    prepStmtDsbrsmntPmtr = conn.prepareStatement(updateDbPmtr);                     
    prepStmtStckWght      = conn.prepareStatement(updateStkWght);
                        String minDsbrsmntAmount     = parametersListForm.getParametersForm().getMinDisbursementAmt();
                        String specialHndlAmount     = parametersListForm.getParametersForm().getSpecialHandlingAmt();
                        String statementDt               = parametersListForm.getParametersForm().getStatementDate();
                        String overrideCycleDt          = parametersListForm.getParametersForm().getOverrideCycleDate();
                        String lastMdfdBy               = parametersListForm.getParametersForm().getLastModifiedBy();
                        String lastMdfdDt               = parametersListForm.getParametersForm().getLastModifiedDate();
                        String wtStmtStkSheet          = parametersListForm.getParametersForm().getWtStatementStockSheet();
                        String wtHlfFoldEnvelope     = parametersListForm.getParametersForm().getWtHalfFoldEnv();
                        String wtFltEnvelope          = parametersListForm.getParametersForm().getWtFlatEnv();
                        String wtChkStkSheet          = parametersListForm.getParametersForm().getWtCheckStockSheet();
    prepStmtDsbrsmntPmtr.setLong(1,Integer.parseInt(minDsbrsmntAmount));
    prepStmtDsbrsmntPmtr.setLong(2, Long.parseLong(specialHndlAmount));
    prepStmtDsbrsmntPmtr.setString(3,lastMdfdBy);
    prepStmtDsbrsmntPmtr.setLong(4,1);
    prepStmtDsbrsmntPmtr.setLong(5,1);
    int rUpdtInParam = prepStmtDsbrsmntPmtr.executeUpdate();
    ========================================================================
    I am getting following errors...
    [8/6/04 19:17:14:286 GMT+05:30] 19192340 SystemErr R java.sql.SQLException: ORA-01006: bind variable does not exist
    [8/6/04 19:17:14:302 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:314)
    [8/6/04 19:17:14:317 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:117)
    [8/6/04 19:17:14:349 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:306)
    [8/6/04 19:17:14:364 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:43)
    [8/6/04 19:17:14:380 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:41)
    [8/6/04 19:17:14:411 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:941)
    [8/6/04 19:17:14:427 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:662)
    [8/6/04 19:17:14:442 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:214)
    [8/6/04 19:17:14:474 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:135)
    [8/6/04 19:17:14:489 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:227)
    [8/6/04 19:17:14:505 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:72)
    [8/6/04 19:17:14:536 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:190)
    [8/6/04 19:17:14:552 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:406)
    [8/6/04 19:17:14:567 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:57)
    [8/6/04 19:17:14:583 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:461)
    [8/6/04 19:17:14:614 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:414)
    [8/6/04 19:17:14:630 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:614)
    [8/6/04 19:17:14:661 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:57)
    [8/6/04 19:17:14:677 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:461)
    [8/6/04 19:17:14:692 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:414)
    [8/6/04 19:17:14:708 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:614)
    [8/6/04 19:17:14:739 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:414)
    [8/6/04 19:17:14:755 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:614)
    [8/6/04 19:17:14:770 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:414)
    [8/6/04 19:17:14:802 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:614)
    [8/6/04 19:17:14:817 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:414)
    [8/6/04 19:17:14:833 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:614)
    [8/6/04 19:17:14:864 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:190)
    [8/6/04 19:17:14:880 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:406)
    [8/6/04 19:17:14:896 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:614)
    ========================================================================
    Database Table:-
    Desc D9T651_DSBRSMNT_PRMTR:
    Name Null? Type
    DSBRSMNT_PRMTR_ID NOT NULL NUMBER(38)
    INS_SYS_ID NUMBER(38)
    MIN_DSBRSMNT_AMT NUMBER(15,2)
    OVRRD_MIN_DSBRSMNT_DT DATE
    SPCL_HNDLG_AMT NUMBER(15,2)
    STMNT_DT DATE
    CRTD_BY VARCHAR2(30)
    CRTD_DT DATE
    LAST_CHNGD_BY VARCHAR2(30)
    LAST_CHNGD_DT DATE

    What exactly are you trying to do? If you're trying to run an update statement, it's simpler if you do this:
    PreparedStatement pstmt = null;
    Connection conn = ?????;
    String updateStr = "UPDATE D9T652_DISBRSMNT_PRMTR " +
    "SET " +
    "Stmnt_Page_Wgt_Ozs = ?, " +
    "Chk_Page_Wgt_Ozs = ?, " +
    "Flat_Envelope_Wgt_Ozs = ?, " +
    "Half_Fold_Envelope_Wgt_Ozs = ?, " +
    "Last_Chngd_By = TRIM(?), " +
    "Last_Chngd_Dt = ? " +
    "WHERE " +
    "Ins_Sys_Id = Ins_Sys_Id_Constant_For_Compass AND " +
    "Last_Chngd_Dt = (SELECT MAX(Last_Chngd_Dt) " +
    "FROM D9T652_DISBRSMNT_PRMTR " +
    "WHERE Ins_Sys_Id = Ins_Sys_Id_Constant_For_Compass) "
    From the String constructed above, the first ? mark will be bind to 1, second to 2..... etc and you can set the appropriate types.
    pstmt = conn.prepareStatement(updateStr);
    pstmt.setString(1, request.getParameter("formValue1")); // this is assuming you want to store string value in DB field
    pstmt.setInt(2, Integer.parseInt(request.getParameter("formValue2"))); // this is assuming you want to store int value in DB field
    pstmt.setTimestamp(3, new java.sql.Timestamp(new java.util.Date().getTime())); // this is assuming you want to store current time in DB Date field
    ..... etc
    ..... etc
    ...... etc
    int rows = pstmt.executeUpdate();
    Hope this helps!!

  • 500 - Internal Server Error - Table or View does not Exist

    When trying to use the sample restful service oracle.example.hr I get a 500 - Internal Server Error.
    I have no clue what to do next. I've even tried granting public to the emp table.  Nottin.
    Any insight you could give would be awesome.
    Here is the error:
    Request Path passes syntax validation
    Mapping request to database pool: PoolMap [_failed=false, _lastUpdate=-1, _pattern=null, _poolName=apex, _regex=null, _type=REGEX, _workspaceIdentifier=null, _serviceName=null]
    Applied database connection info
    Attempting to process with PL/SQL Gateway
    Not processed as PL/SQL Gateway request
    Attempting to process as a RESTful Service
    Determining if request can be dispatched as a Tenanted RESTful Service
    Request path has one path segment, continuing processing
    No Tenant Principal established yet, continuing processing
    APEX_LISTENER pool exists, continuing processing
    WebException [statusCode=500]
         at oracle.dbtools.rt.web.WebException.webException(WebException.java:343)
         at oracle.dbtools.rt.web.WebException.internalError(WebException.java:262)
         at oracle.dbtools.rt.web.WebErrorResponse.internalError(WebErrorResponse.java:101)
         at oracle.dbtools.rt.web.WebErrorResponse.error(WebErrorResponse.java:75)
         at oracle.dbtools.rt.web.HttpEndpointBase.service(HttpEndpointBase.java:166)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3732)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    Caused by: JDBCException [kind=NO_DATA]
         at oracle.dbtools.common.jdbc.JDBCException.wrap(JDBCException.java:88)
         at oracle.dbtools.common.jdbc.JDBCQueryProvider.query(JDBCQueryProvider.java:41)
         at oracle.dbtools.rt.jdbc.entity.JDBCTenantDispatcher.tenant(JDBCTenantDispatcher.java:104)
         at oracle.dbtools.rt.jdbc.entity.TenantDispatcherBase.target(TenantDispatcherBase.java:71)
         at oracle.dbtools.rt.jdbc.entity.TenantDispatcherBase.target(TenantDispatcherBase.java:37)
         at oracle.dbtools.rt.web.ReTargetingDispatcher.canDispatch(ReTargetingDispatcher.java:45)
         at oracle.dbtools.rt.web.RequestDispatchers.choose(RequestDispatchers.java:160)
         at oracle.dbtools.rt.web.RequestDispatchers.dispatch(RequestDispatchers.java:75)
         at oracle.dbtools.rt.web.ETags.checkPrecondition(ETags.java:53)
         at oracle.dbtools.rt.web.HttpEndpointBase.restfulServices(HttpEndpointBase.java:426)
         at oracle.dbtools.rt.web.HttpEndpointBase.service(HttpEndpointBase.java:164)
         ... 14 more
    Caused by: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
         at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
         at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:505)
         at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:223)
         at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:208)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:886)
         at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1175)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1288)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3612)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3656)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1495)
         at sun.reflect.GeneratedMethodAccessor70.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at oracle.ucp.jdbc.proxy.PreparedStatementProxyFactory.invoke(PreparedStatementProxyFactory.java:111)
         at $Proxy104.executeQuery(Unknown Source)
         at oracle.dbtools.common.jdbc.JDBCQueryImpl.resultSet(JDBCQueryImpl.java:93)
         at oracle.dbtools.common.jdbc.JDBCResultRowIterator.<init>(JDBCResultRowIterator.java:28)
         at oracle.dbtools.common.jdbc.JDBCQueryImpl.execute(JDBCQueryImpl.java:53)
         at oracle.dbtools.common.jdbc.JDBCQueryProvider.query(JDBCQueryProvider.java:38)
         ... 23 more

    May be the default parsing schema in your Apex workspace cannot access table EMP. Try and qualify table EMP and grant access from containing schema to Apex parsing schema. Hope being helpful, regards.

Maybe you are looking for

  • About to purchase Mac Mini

    I have never used a Mac Mini. What else do I need once purchased to get it up and running. For example, will accessories previously used with Windows 7 work, i.e. Samsung monitor with it's own controls External DVD writer And, does the Mac Mini have

  • How to call stored procedure having parameter as oracle type from java???

    Hello, I have created following type & stored procedure in oracle. How can i call this stored procedure from my java class? I want to pass 2d array to this procedure. CREATE OR REPLACE TYPE type_survey AS OBJECT ( emp_id number,emp_name varchar(100))

  • Purchase requisition (msg error)

    hi during the inception of the purchase requisition, and Once I click ENTRE after going to enter the material code. SAP displays the following message : ""Conflicts in screen size; for more information, see the note SAP 570861"" what this means ? bes

  • 10.5.7 - randomly wakes up from sleep.

    After updating to 10.5.7 my iMac starts up from sleep function randomly, aprox. 25 min after it goes to sleep. If I choose sleep from the menu or it goes automatically it always starts up again. I have to turn the machine off to avoid this. Can anyon

  • Why I can't update Mail from 4.5 to 5?

    I use Mail 4.5 and this is, denifitively, a poor client. Why I can't have Mail 5, in order to try something better?