Excel-2007 cannot connect to Oracle ODBC data source, Control Panel can.

<p>
I cannot make an ODBC connection from Exce-2007 to Oracle work. I am an expert Excel and VBA user (since 1994) and I have frequently used Excel to access ODBC databases, including Oracle (I have done this with Excel-2003 both with worksheet queries and have written VBA ADO-connection routines). And even though in Excel-2007 a worksheet ODBC query is supposed to be easier to create than in previous version of Excel, my connection fails. Any suggestions and all help are welcome and much appreciated.
DETAILS
</p>
<p>
1) <strong>What is my system?</strong> I am using Excel-2007 on Windows Vista x64 and Oracle server v.11g on my computer (all this is on my computer, no network issues).
2)<strong> Why use Excel with Oracle at all?</strong> I use Excel-2007 to access Oracle rather than Access-2007 (or any other application like TOAD, etc.) because I do engineering calculations with the data stored in Oracle. These calculations are easier done in Excel (I suppose that one alternative to this could be to use some sql or Access to get the data from the database, then store it as plain vanilla CSV file, then open this file in Excel, then do the math (the math involves complex optimisation algorithms), then save the results as CSV, then use some sql or Access to put the data back into the database. Howwever this does not strike me as a quick or neat solution. And after all Excel has been designed to access ODBC databases, so why not use it?)
3) <strong>What do I do in Excel-2007 that won't work?</strong> I create an ODBC link to Oracle that does not work. In Excel-2007 this is straightforward:
</p>
<ul>
     <li>define an ODBC connection (Data tab --&gt; From other sources --&gt; From data connection wizard);</li>
     <li>define a query on the worksheet -- that's it, this is all!</li>
</ul>
<p>
I start with creating an ODBC connection:
a) I choose an ODBC data source type: <strong><em>ODBC DSN</em></strong>
b) Excel-2007 displays the list of the available ODBC data sources. I see in it <strong><em>my Oracle database name</em></strong> and I select it.
c) Excel-2007 displays the Data Link Properties:
- the "Provider" has a list of the OLE DB drivers with preselected "<strong><em>Microsoft OLE DB Provider for ODBC Drivers</em></strong>". I keep this default selection.
- the "Connection" tab has a connection string "<strong><em>DSN=&lt;my database name&gt;</em></strong>" which I keep, it also has fields for the <strong><em>user name</em></strong> and the <strong><em>password</em></strong>, which I fill with the correct credentials.
- Finally there is a button "Test Connection", which when I click produces the following error message:
<strong><font color="#ff0000">"Test connection failed because of an error in initializing provider.</font></strong><strong><br />
</strong><strong><font color="#ff0000">Unespecified error"</font></strong><strong>
</strong>
4) <strong>Additional food for thought:</strong>
a) In the above walk-through the only data, which I type, are the user name and password, everything else is selected from lists offered by Excel-2007, hence any possibility of typos being the cause of the problem can safely be discarded.
b) I can test the ODBC driver in the Control Panel and it shows that it can connect to the Oracle database:
- in <strong><em>Control Panel --&gt; Admin Tools --&gt; Data Sources (ODBC)</em></strong> on the "User DSN" tab I can see the list of the available ODBC data sources (same list as in Excel-2007, point 3b above) with the name of my database in it;
- selecting the name of my database from the list of the sources and clicking "Configure" button opens a tab with <strong><em>Data Source Name</em></strong> (same as in Excel-2007), TNS Service Name and User ID. I enter <strong><em>&lt;user name&gt;/&lt;password&gt;</em></strong> and click "Test Connection" button. A message "<strong><em>Connection successful</em></strong>" appears (just for a test I enter <u>incorrect user credentials</u> and "<strong><em>Unable to connect</em></strong>" message appears)
BOTTOM LINE
</p>
<p>
The procedure for using an ODBC connection from Excel is very simple, in the past I have created and used such connections numerous times with Excel-2003 and earlier on Win-XP and earlier. But now on Excel-2007 and Vista-x64 I cannot make it work.
Also, testing an ODBC connection driver is really easy and simple to be done in the Control Panel. There testing the same ODBC connection, which fails in Excel-2007, results in success.
I am frustrated by the simplicity of the problem and yet the persistant error. I have lost now two full days in failed attempts to make the simple procedure work and in searching the internet for answers.
All help is highly appreciated <img class="emoticon" src="images/emoticons/happy.gif" border="0" alt="" width="16" height="16" />,
Plamen
</p>

Did you find the solution to your problem?
If not, I think I may know.
Excel 2007 is a 32-bit application.
When installing 32-bit applications in a 64-bit environment, the "default" location is:
C:\Program files (x86)\...
Excel then launches from this location.
However, when it connects to Oracle and passes the name of the calling program, Oracle attempts to "interpret" the value of (x86) as if
the value within the parenthesis are being passed as a reference. Of course, iOracle doesn't find anything, so the result is (),
and then it cannot return the connection info back to the calling application.
I corrected it by installing Excel in C:\Program Files\, and once launched from that location, it works the same as on the 32-bit machines.
However, at my location, they are FORCING Excel to be installed in the(x86) location.
What I'm trying to discover now is:
Is it possible to flag Oracle to NOT process the embedded variables?
Or, is it possible to assign a variable in Oracle such that x86 = "(x86)", so that the end result is viable?
Have you had any luck with your installation?
thanks,
Paul

Similar Messages

  • Cannot see System DSN ODBC Data source (however user DSN is Ok)

    We have installed BO 6.5.1 on Windows 2008 R2 64 bit and set up ODBC Data source to the existing SQL server.
    When we try to set the BO up (Administration>Safe recovery etc.), in the "Database middleware selection" - "Define new connection" - "Data source name" we cannot see the System DSN name that we've created in the Window's "ODBC data source administration" control panel applet. If we create a User DSN, we can see it ok but it works for one user only (as it should).
    So, in a nutshell, if we setup a User DSN it works fine but if we setup a system-wide System DSN BO cannot see it. I've got no idea why...
    Can anyone point me to the right direction, please?

    Are you using the ODBC Administrator from control panel?  If so, try launching this instead:  odbcad32.exe from start/run.
    This is the 32-bit ODBC administrator and since we are a 32-bit application, a 32-bit DSN will need to be configured.
    Here's another forum thread that may be helpful:
    http://social.msdn.microsoft.com/Forums/en/sqldataaccess/thread/49e206c3-f4f8-4757-8990-71b93120d2bc
    and this one too:
    http://forums.techarena.in/windows-x64-edition/698703.htm
    Thanks
    Jonathan

  • Excel 2007 = Refresh All = Error Message "Initialization Data Source Failed"

    Excel 2007 => Data Tab - Refresh All => Error Message "Initialization Data Source Failed
    2nd Error message:
    The following data ranged failed to refresh:  ExternalData1 - Continue to refresh all
    How do I resolve this? Trying to connect to Oracle DB environment 12C

    What will happen if you rebuild the PivotTable/Table ?
    Make sure the external database is available and the Oracle Provider for OLE DB is installed correctly.
    Wind Zhang
    TechNet Community Support

  • ODBC Data source administrator hanging for 20 seconds

    After installing 32 bit ODAC 11.2 Release 5 and Oracle Developer Tools for Visual Studio (11.2.0.3.20) our business is reporting slow Excel/VBA code using ODBC.
    The business are querying using a ODBC System DSN. It works but hangs for 20 second when VBA releases the connection.
    I can see that I get the same pause after testing the connection in the "ODBC Data Source administrator"
    1. Open ODBC Data Source administrator
    2. Edit the System DSN
    3. Push "Test Conncetion". Says "Connection succesful". Push OK
    4. Push "OK"
    ODBC Data Source administrator now hangs for 20 seconds.
    I did a clean installation on a Win7 x64 machine using 32 bit ODBC Data Source administrator
    Nothing to find in the eventlog.
    Does anyone know what could be wrong?

    Udpate: I tracked it down to Microsoft ISA Firewall Client installation. If I uninstall the ISA Firewall the problem disappears.
    Only disabling the ISA Firewall doesn't help!
    Other have reported the same behaviour https://groups.google.com/forum/#!topic/microsoft.public.isa.clients/F14GNANHppA
    Any help will be appreciated!
    Thanks

  • Cannot get ODBC data source to talk to Oracle 10g for Windows

    Problem description
    I recently installed Oracle 10g on my laptop computer, which is running Windows 7. Everything went smoothly except for one crucial item: The ODBC data source I added keeps returning this error when I click the "Test Connection" button:
    Testing Connection
    Unable to connect
    [Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_ENV failed.
    I was using the following ODBC driver
    Oracle in OraDb10g_home1 (TNS Service Name = ORCL and User ID = scott)
    This type of error happened, in one form or another for the three other Oracle drivers I have on my machine
    Microsoft ODBC for Oracle
    WinSQL Oracle
    WinSQL Oracle Wire Protocol
    These services are currently running (status = Started)
    OractDBConsoleorcl
    OracleMTSRecoveryService
    OracleOraDb10g_home1iSQL*Plus
    OracleOraDb10g_home1TNSListener
    OracleServiceORCL
    (NOTE: I entered the foregoing information by hand, since I was not able to copy-and-paste it. So be aware that there is a small possibility of a minor typo in case you plan to cut-and-paste it.)
    If requested, I can provide the contents of these files
    tnsnames.ora
    sqlnet.ora
    listener.ora
    Other installations on the same computer
    ODAC (ADO data provider for Oracle)
    SQL Server 2009 Express
    .NET 4
    Visual Studio 2010
    Any help would be greatly appreciated!

    OK, I went ahead and upgraded to Windows 7 Professional and I STILL get the same error messages when trying to get the Oracle ODBC driver to talk to Oracle 10g. Here are some screen shots that show what happened:
    1) Select ODBC driver: http://yfrog.com/f3driverselectionp
    2) Configure driver: http://yfrog.com/ccoracleodbcfororaclep
    3) Test connection: http://yfrog.com/1goracleodbcfororacletestp
    I also get the following error when I try to run SQL*Plus from the line command, even with no parameters:
    C:\Users\Bruce>sqlplus
    SP2-1503: Unable to initialize Oracle call interface
    SP2-0152: ORACLE may not be functioning properly
    Any suggestions as to how I might to go about diagnosing (and fixing) this problem?
    Thanks,
    Bruce

  • Cannot connect to Oracle through ODBC.

    Please help, I don't know what else to try.
    I'm writing automated test scripts and frequently need to access the database to verify data values. These scripts run under multiple environments and have to validate several different flavors of database products. I use ODBC to establish the database connection and this works well under everything except the following environment:
    Database Host:
    Windows Server 2008, Standard Edition
    Oracle 10g
    Client:
    Windows Server 2008 Standard (64-bit)
    Oracle 11g client software installed.
    Following recommendations here on the Oracle site, I used the OUI to remove the Oracle ODBC driver that is installed with the client software and installed RDBODBC3320_x64.msi.
    I was unable to connect to the database at all using the Oracle 10g client software under this environment, but it is my understanding that Oracle 11g should work. I don't have much choice. The Oracle 10g client refused to install in this environment.
    I am able to create a DSN for the database using the ODBC Data Source Administrator. I specify the configuration correctly, but when I try to test the connection, it returns the error:
    FAILED: Service Connection test
    rc=-1
    SQLState=08S01
    [Oracle][ODBC][Rdb] Connect Ret -1 Err# 10061
    WSAECONNREFUSED Connection refused
    I interpret this to mean that I'm reaching the server and database, but it isn't recognizing the connection as being from a legitimate account. Am I wrong?
    From this client machine, I am able to connect to and query the database using SQLPlus, so it isn't that the database is unavailable from the test machine.
    On the host server, I am able to create an ODBC configuration that tests successfully. That is, of course, the 10g version of the ODBC driver.
    I hope someone can supply an answer, this is a high visibility item that is making me look foolish.
    Thanks,
    Dave P.

    Hi Dave,
    It's difficult to make decent recommendations without knowing for sure even what kind of database you're connecting to, or what issues you're having exactly. "No success with the 64 bit flavor" doesn't provide much info to go on.
    Here's the bullet points that will hopefully get you working, assuming you're connecting to "regular" oracle and that this whole RDB thing was a wild goose chase. If you're actually connecting to an RDB database, skip all the steps below and go post in the RDB forum to get their advice. If you're not sure what the difference is, or what you're connecting to, ask someone who knows.
    *1)* Are you ultimately trying to connect with a 32 bit app or a 64 bit app, from the 64 bit 2008 box?
    - What kind of "scripts" are you writing? VBSscript you're executing from a DOS prompt? If so, how are you invoking it exactly? Just by typing filename.vbs?
    - Are the scripts running with 32bit cscript.exe or 64 bit cscript.exe?
    The bottom line is that 32 bit apps need 32 bit client software, and 64 bit apps need 64 bit client software, and you need to have the right stuff installed. The first thing you need to figure out is whether you're running 32 bit app or 64 bit process. Usually you can open Task Manager and look for the process name in the Process tab; if there's a *32 next to it, it's 32 bit. Otherwise it's 64 bit.
    *2)* Once you determine what bitness the software you're running is, you then need to download and install that bitness of Oracle client software. You can get 11.2.0.1 here:
    32 bit 11.2 client:
    http://www.oracle.com/technetwork/database/enterprise-edition/downloads/112010-win32soft-098987.html
    64 bit 11.2 client:
    http://www.oracle.com/technetwork/database/enterprise-edition/downloads/112010-win64soft-094461.html
    *3)* After downloading the client.zip and extracting it, run setup.exe, take the defaults, chose Custom install type, select ODBC driver and SQLPlus from the list, and the installer will automatically install the Oracle software as well.
    Note: You could use Instant Client for this as well; but you'll have to download and install SQLPlus and the ODBC driver in addition to the instant client itself, and using the OUI and the Full client installation is "easier" as it doesn't require manual installation like Instant client does, so less error prone.
    *4)* Configure tnsnames.ora for that install so the client knows where you want to connect to, test it using sqlplus from that install location to make sure you have it right.
    *5)* If you want to configure a 32 bit dsn, you need to use the 32 bit administrator ( c:\windows\syswow64\odbcad32.exe).
    64 bit dsn's you configure via c:\windows\system32\odbcad32.exe (or via control panel > odbc administrator).
    *6)* Run your app, hopefully you're dialed.
    *7)* Profit.
    Hope it helps,
    Greg

  • Using Excel & ODBC data source to get data

    I've been using MS Excel to extract MS SQL Server data from our ERP system for years but we are now moving to Oracle 12i. What are my options in the Oracle world? Can it be configured much the same way; that is by configuring an ODBC data source and connecting directly to the database???
    Thanks in advance.

    user11307988 wrote:
    I've been using MS Excel to extract MS SQL Server data from our ERP system for years but we are now moving to Oracle 12i. What are my options in the Oracle world? Can it be configured much the same way; that is by configuring an ODBC data source and connecting directly to the database???
    Thanks in advance.Adding to sb92075's brief but accurate statement, from one of my recent presentations (note - no need for an ODBC connection):
    'Need to add a reference to Microsoft ActiveX Data Objects 2.8 Library before starting
    '*** This section might be in the top portion of the user form, worksheet code, or module:
    'Declare a connection object in the general section to hold the connection to the database
    Dim dbVMFG As ADODB.Connection
    'Declare a set of variables to hold the username and password for the database
    Dim strUserName As String
    Dim strPassword As String
    Dim strDatabase As String
    Dim i as Integer
    Dim intResult As Integer
    Dim strSQL as String
    Dim lngRow as Long
    On Error Resume Next
    strDatabase = "MyDB"
    strUserName = "MyUser"
    strPassword = "MyPassword"
    'Connect to the database
    'Oracle connection string
    Set dbVMFG = New ADODB.Connection
    dbVMFG.ConnectionString = "Provider=OraOLEDB.Oracle;Data Source=" & strDatabase & ";User ID=" & strUserName & ";Password=" & strPassword & ";ChunkSize=1000;FetchSize=100;"
    dbVMFG.ConnectionTimeout = 40
    dbVMFG.CursorLocation = adUseClient
    dbVMFG.Open
    If (dbVMFG.State <> 1) Or (Err <> 0) Then
        intResult = MsgBox("Could not connect to the database.  Check your user name and password." & vbCrLf & Error(Err), 16, "Excel Demo")
    Else
        strSQL = "SELECT" & VBCrLf
        strSQL = strSQL & "  ID AS RESOURCE_ID," & VBCrLf
        strSQL = strSQL & "  DESCRIPTION" & VBCrLf
        strSQL = strSQL & "FROM" & VBCrLf
        strSQL = strSQL & "  MY_TABLE" & VBCrLf
        strSQL = strSQL & "WHERE" & VBCrLf
        strSQL = strSQL & "  DESCRIPTION LIKE '%10%'" & VBCrLf
        strSQL = strSQL & "ORDER BY" & VBCrLf
        strSQL = strSQL & "  ID"
        'Add a new worksheet to the new workbook, add after the last sheet
        ActiveWorkbook.Sheets.Add
        ActiveWorkbook.ActiveSheet.Name = "JustATest"
        snpData.Open strSQL, dbVMFG
        If snpData.State = 1 Then
            'Slow Method------------------------------------
            lngRow = 0
            'Header Row
            For i = 0 To snpData.Fields.Count – 1
                lngRow = lngRow + 1
                ActiveSheet.Cells(lngRow, i + 1).Value = snpData.Fields(i).Name
                ActiveSheet.Cells(lngRow, i + 1).Font.Bold = True
            Next i
            'Detail Rows
            Do While Not snpData.EOF
                lngRow = lngRow + 1
                For i = 0 To snpData.Fields.Count - 1
                    ActiveSheet.Cells(lngRow, i + 1).Value = snpData.Fields(i)
                Next i
                snpData.MoveNext
            Loop
            'End Slow Method------------------------------------
            'Fast Method----------------------------------------
            'Do not use this and the slow method!
            For i = 0 To snpData.Fields.Count - 1
                ActiveSheet.Cells(1, i + 1).Value = snpData.Fields(i).Name
            Next i
            ActiveSheet.Range(ActiveSheet.Cells(1, 1), ActiveSheet.Cells(1, snpData.Fields.Count)).Font.Bold = True
            ActiveSheet.Range("A2").CopyFromRecordset snpData
            'Auto-fit up to 26 columns
            ActiveSheet.Columns("A:" & Chr(64 + snpData.Fields.Count)).AutoFit
            'End Fast Method----------------------------------------
            snpData.Close
        End If
    End IfA couple of notes:
    1. Do not repeatedly connect to the database, execute a SQL statement, and disconnect from the database - connect once and stay connected.
    2. Use bind variables where possible in SQL statements for constants (literals) which might change from one execution to the next - let me know if you need s code example showing bind variable usage in Excel.
    Charles Hooper
    IT Manager/Oracle DBA
    K&M Machine-Fabricating, Inc.

  • VB6 source code cannot connect to Oracle database after compile to file.exe

    Hi All,
    I have a problem about VB6 connect with Oracle database. It can connect as normal when run on VB program. After compiled to file.exe and execute, it cannot connect to Oracle database. What's going on ? Please advise? Thank you.
    Here is sample of my code connection.
    Option Explicit
    Private wsData As New ADODB.Connection
    wsData.ConnectionString = _
    "Provider=MSDAORA.1;User ID=lsp;Password=lsp2007;Data Source=prd01;Persist Security Info=False"
    wsData.Open
    End sub
    Rgads,
    Ats.

    Hi,
    I believe you're in the wrong forum, this forum is for Oracle Application Express.

  • Oracle 817 client not available in ODBC Data Source Administrator pick list...

    I have installed Oracle 817 client on a PC.
    I can see the server, I can see the instance.
    I can log into the instance using SQLPlus with no problem.
    The product I'm using requires an ODBC connection configured in the ODBC Data Source Administrator.
    When I try to configure it in the DSA, Oracle 8 is not in the list.
    HELP!

    I assume you have Windows on the client. The "Drivers" page of the ODBC_DSA should list all installed drivers. You require:
    name= Oracle ODBC Driver
    version= 8.01.07.00 (or something similar)
    company= Oracle Corporation DO NOT USE the Microsoft one.
    If this does not show, then either it was not included in the Oracle Client installation or you have not rebooted after the Oracle Client installation; the ODBC driver is not visible until rebooted.

  • Error while connecting to oracle 10g data base

    Following is the code we used to connect to oracle 10g data base using symbian 7.1 series 80 SDK
    int CTest_S80AppUi::SetupODBC(void)
    RETCODE rc;
    char *DataSource = OD_DATA_SOURCE;
    char UserId = "system", Password = "manager";
    rc=SQLAllocEnv(&Henv);
    //if (TEST_CHECK_ERR(SQL_NULL_HSTMT, rc, "SQLAllocEnv", FALSE) < 0) return(-1);
    rc=SQLAllocConnect(Henv, &Hdbc);
    //if (TEST_CHECK_ERR(SQL_NULL_HSTMT, rc, "SQLAllocConnect", FALSE) < 0)
         //return(-1);
    rc = SQLConnect(Hdbc, (unsigned char *)DataSource, SQL_NTS,
              (unsigned char *)UserId, SQL_NTS,
              (unsigned char *)Password, SQL_NTS);
    bConnected = TRUE;
    //if (TEST_CHECK_ERR(SQL_NULL_HSTMT, rc, "SQLConnect", FALSE) < 0) return(-1);
    SQLAllocStmt(Hdbc, &Hstmt);
    //if (TEST_CHECK_ERR(SQL_NULL_HSTMT, rc, "SQLAllocStmt", FALSE) < 0) return(-1);
    return (1);
    } /* SetupODBC */
    iam getting the return code for SQLConnect as -1.
    Thanks in advance.

    Thanks for the reply.
    //syntax means comments.
    chk the following code.
    int SetupODBC(void)
    char *DataSource = "polite";
    char UserId = "system", Password = "manager";
    if ( SQLAllocEnv(&Henv) < 0 )
    return -1;
    if ( SQLAllocConnect(Henv, &Hdbc) < 0 )
    return -1;
    if ( SQLConnect(Hdbc, (unsigned char *)DataSource, SQL_NTS,
    (unsigned char *)UserId, SQL_NTS,
    (unsigned char *)Password, SQL_NTS) < 0 )
    return -1;
    if (SQLAllocStmt(Hdbc, &Hstmt) < 0 )
    return -1;
    return (0);
    As said earlier there is a problem in SQLConnect. It is returning -1.
    But the code should return 0 if successfully connected.
    The info regarding the arguments used in the above methods:
    HENV Henv; /* Handle to ODBC Environment object */
    HDBC Hdbc; /* Handle to ODBC Connection object */
    HSTMT Hstmt; /* Handle to ODBC Statement object */

  • Setting up an ODBC data source to connect to BerkleyDB

    How can I set up an ODBC data source (DSN) to connect to BerkleyDB. I installed Berkeley DB 11gR2 (11.2.5.0.21) on Windows XP 32-bit and I can see the sqlite3odbc.dll in the installation bin folder but there seems to be no BerkleyDB ODBC driver listed in Windows ODBC Adminstrator app

    Hi,
    I'm afraid that we don't ship an installer with our initial release. It is possible to install manually, but it requires making some changes to the source code, building the ODBC driver and installing manually.
    The steps are as follows:
    <li>Edit the file db-5.0.21/sql/odbc/sqlite3odbc.c at line 15919 change "drivername" and "dsname" variables to contain the driver strings you would like to use.
    <li>Follow the instructions to build the dll in the install guide here: http://www.oracle.com/technology/documentation/berkeley-db/db/installation/build_win_sql.html#id3371140. NOTE: You only want to follow the build steps here, not the configure or install steps.
    <li> Once you have built the sqlite3odbc.dll file, you'll need to follow the manual install steps defined in the README here: http://www.ch-werner.de/sqliteodbc/README . Search for the section titled Win32 install/remove/shell by RUNDLL32
    I hope this helps, let me know if you need further information.
    Regards,
    Alex Gorrod, Oracle Berkeley DB

  • Multiple excel files - ODBC Data Source Administrator

    I have about 1750 excel files that I need to convert to text format.
    Is it possible to ... configure all files in the ODBC Data Source Administrator window?

    If you need these DSNs for Java only, you can define them directly inside the connect string.
    Look at these previous topics:
    http://forum.java.sun.com/thread.jsp?forum=48&thread=150956
    http://forum.java.sun.com/thread.jsp?forum=48&thread=218662
    Call again, if you don't succeed.

  • Problem using excel file as odbc data source

    hi, I have followed the instruction in
    "Creating a Repository Using the Oracle Business Intelligence Administration Tool"
    [http://www.oracle.com/technology/obe/obe_bi/bi_ee_1013/bi_admin/biadmin.html]
    and established a odbc data source using an excel file.
    however, I found that the Microsoft Excel Driver always unable to handle complex column formula.
    for example,
    FILTER(sourceTable$.NoOfItem USING (sourceTable$.Kind = 'Lemon'))
    when there are two columns using FILTER, there is an error about the ODBC driver.
    =============================================================
    Odbc driver returned an error (SQLExecDirectW).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 16001] ODBC error state: 37000 code: -3100 message: [Microsoft][ODBC Excel Driver] Syntax error (missing operator) in query expression 'sum(case when T3552.[Kind] = 'Orange' then T3552.[NoOfItem] end )'.. [nQSError: 16014] SQL statement preparation failed. (HY000)
    SQL Issued: SELECT "sourceTable$".Market saw_0, FILTER("sourceTable$".NoOfItem USING ("sourceTable$".Kind = 'Orange')) saw_1, FILTER("sourceTable$".NoOfItem USING ("sourceTable$".Kind = 'Lemon')) saw_2 FROM excel_source ORDER BY saw_0
    =============================================================
    However, I change the data source using SQL SERVER, no error occurs and it shows the result correctly.
    how to slove this problem?

    I have the same issue. Does anyone know how to solve it?

  • Excel SSAS Tabular error: An error occurred during an attempt to establish a connection to the external data source

    Hello there,
    I have an Excel report I created which works perfectly fine on my dev environment, but fails on my test environment when I try to do a data refresh.
    The key difference between both dev and test environments is that in dev, everything is installed in one server:
    SharePoint 2013
    SQL 2012: Database Instance, SSAS Instance, SSRS for SharePoint, SSAS POWERPIVOT instance (Powerpivot for SharePoint).
    In my test and production environments, the architecture is different:
    SQL DB Servers in High Availability (irrelevant for this report since it is connecting to the tabular model, just FYI)
    SQL SSAS Tabular server (contains a tabular model that processes data from the SQL DBs).
    2x SharePoint Application Servers (we installed both SSRS and PowerPivot for SharePoint on these servers)
    2x SharePoint FrontEnd Servers (contain the SSRS and PowerPivot add-ins).
    Now in dev, test and production, I can run PowerPivot reports that have been created in SharePoint without any issues. Those reports can access the SSAS Tabular model without any issues, and perform data refresh and OLAP functions (slicing, dicing, etc).
    The problem is with Excel reports (i.e. .xlsx files) uploaded to SharePoint. While I can open them, I am having a hard time performing a data refresh. The error I get is:
    "An error occurred during an attempt to establish a connection to the external data source [...]"
    I ran SQL Profiler on my SSAS Server where the Tabular instance is and I noticed that every time I try to perform a data refresh, I get the following entries:
    Every time I try to perform a data refresh, two entries under the user name ANONYMOUS LOGON.
    Since things work without any issues on my single-server dev environment, I tried running SQL Server Profiler there as well to see what I get.
    As you can see from the above, in the dev environment the query runs without any issues and the user name logged is in fact my username from the dev environment domain. I also have a separated user for the test domain, and another for the production domain.
    Now upon some preliminary investigation I believe this has something to do with the data connection settings in Excel and the usage (or no usage) of secure store. This is what I can vouch for so far:
    Library containing reports is configured as trusted in SharePoint Central Admin.
    Library containing data connections is configured as trusted in SharePoint Central Admin.
    The Data Provider referenced in the Excel report (MSOLAP.5) is configured as trusted in SharePoint Central Admin.
    In the Excel report, the Excel Services authentication settings is set as "use authenticated user's account". This wortks fine in the DEV environment.
    Concerning SecureStore, PowerPivot Configurator has configured it the PowerPivotUnnattendedAccount application ID in all the environments. There is
    NO configuration of an Application ID for Excel Services in any of the environments (Dev, test or production). Altough I reckon this is where the solution lies, I am not 100% sure as to why it fails in test and prod. But as I read what I am
    writing, I reckon this is because of the authentication "hops" through servers. Am I right in my assumption?
    Could someone please advise what am I doing wrong in this case? If it is the fact that I am missing an Secure Store entry for Excel Services, I am wondering if someone could advise me on how to set ip up? My confusion is around the "Target Application
    Type" setting.
    Thank you for your time.
    Regards,
    P.

    Hi Rameshwar,
    PowerPivot workbooks contain embedded data connections. To support workbook interaction through slicers and filters, Excel Services must be configured to allow external data access through embedded connection information. External data access is required
    for retrieving PowerPivot data that is loaded on PowerPivot servers in the farm. Please refer to the steps below to solve this issue:
    In Central Administration, in Application Management, click Manage service applications.
    Click Excel Services Application.
    Click Trusted File Location.
    Click http:// or the location you want to configure.
    In External Data, in Allow External Data, click Trusted data connection libraries and embedded.
    Click OK.
    For more information, please see:
    Create a trusted location for PowerPivot sites in Central Administration:
    http://msdn.microsoft.com/en-us/library/ee637428.aspx
    Another reason is Excel Services returns this error when you query PowerPivot data in an Excel workbook that is published to SharePoint, and the SharePoint environment does not have a PowerPivot for SharePoint server, or the SQL Server Analysis
    Services (PowerPivot) service is stopped. Please check this document:
    http://technet.microsoft.com/en-us/library/ff487858(v=sql.110).aspx
    Finally, here is a good article regarding how to troubleshoot PowerPivot data refresh for your reference. Please see:
    Troubleshooting PowerPivot Data Refresh:
    http://social.technet.microsoft.com/wiki/contents/articles/3870.troubleshooting-powerpivot-data-refresh.aspx
    Hope this helps.
    Elvis Long
    TechNet Community Support

  • ODBC Data Source Won't Recover from Connection Errors

    I have several ODBC data sources to a mainframe and want to
    use the "Maintain Connections" setting as it dramatically improves
    performance under heavy load. Problem is that we frequently have
    path problems between the CF server and the mainframe 180 miles
    away. With the Maintain Connections checked, the data source
    doesn't consistently start working again after the path problem
    clears up. The path problem usually only lasts a minute or two, but
    SOME queries through the affected data sources continue to raise
    errors until the ODBC Service is cycled. The SOME aspect is really
    weird because not every hit through that data source reports an
    error after the path comes back up. I've had side-by-side users hit
    the same page using that DS and one consistently get's an error and
    the other works fine. Restarting the ODBC service clears the
    problem so it works fine for everybody. Of course that breaks all
    the connections that were still working so I just affected a bunch
    more users. Silver lining there is that at least nobody can claim
    preferential treatment right. It's also kind of bizzare that I can
    use the CF Administrator to verify all data sources and they
    usually all report that they are working fine even while some
    connections are still reporting problems.
    The specific ODBC drivers we are using are Neon Shadow
    Drivers (Multi Threaded). I'm thinking about using the Admin API to
    hit the Disable Connections and then re-enable it.
    Any constructive, tactful input for addressing this problem
    would be appreciated.

    spikehenning wrote:
    > I have several ODBC data sources to a mainframe and want
    to use the "Maintain
    > Connections" setting as it dramatically improves
    performance under heavy load.
    > Problem is that we frequently have path problems between
    the CF server and the
    > mainframe 180 miles away. With the Maintain Connections
    checked, the data
    > source doesn't consistently start working again after
    the path problem clears
    > up. The path problem usually only lasts a minute or two,
    but SOME queries
    > through the affected data sources continue to raise
    errors until the ODBC
    > Service is cycled. The SOME aspect is really weird
    because not every hit
    > through that data source reports an error after the path
    comes back up. I've
    > had side-by-side users hit the same page using that DS
    and one consistently
    > get's an error and the other works fine. Restarting the
    ODBC service clears the
    > problem so it works fine for everybody. Of course that
    breaks all the
    > connections that were still working so I just affected a
    bunch more users.
    > Silver lining there is that at least nobody can claim
    preferential treatment
    > right. It's also kind of bizzare that I can use the CF
    Administrator to verify
    > all data sources and they usually all report that they
    are working fine even
    > while some connections are still reporting problems.
    >
    > The specific ODBC drivers we are using are Neon Shadow
    Drivers (Multi
    > Threaded). I'm thinking about using the Admin API to hit
    the Disable
    > Connections and then re-enable it.
    Do you have a JDBC Type 4 alternative for these drivers? I
    got rid of
    all my datasource problems long ago when I got rid of ODBC
    altogether.
    Jochem
    Jochem van Dieten
    Adobe Community Expert for ColdFusion

Maybe you are looking for