Access Subform - Can the Subforms Source Object be defined by an SQL SP result set?

Hi Guys,
I can't clearly answer this question with a yes or no.
I have an Access Sub Form that I am populating with a record set from a Store Procedure. Fairly early on I discovered that for this to work correctly the Source Object for the Sub Form Control must be set first, and most examples (including a working version
of my own) achieve this by defining an Access Query and setting the Source Object to this.
What I would really like to do is define the Source Object using the results of a SQL Store Procedure using ONLY code within VBA.
Now before anyone starts providing alternatives "why don't you just..."  I'm noting now that I have a semi complex solution that makes most non-VBA based approaches ineffective. While it does work at present with an Access Query I'm needing
to make the result set more dynamic meaning in future I will not know how many columns will be returned or the name of them, only the SP will have this information.
Thanks in advance!

Well after much trial and error I've got something which does what I want, although I'm not thrilled that I couldn't do this via my existing ADODB connections, in any case example provided below;
    Dim db As DAO.Database
    Dim qdf As New DAO.QueryDef
    Set db = CurrentDb()
   'qryMyTest refers to a dummy Access query (non pass through). 
    With db.QueryDefs("qryMyTest")
        .Connect = CurrentDb.TableDefs("tblSomeTestSQLTable").Connect
        .SQL = "exec sp_MyTestSP"
        Me.subfrmTest1.SourceObject = "Query.qryMyTest"
    End With   
    Set qdf = Nothing
I've also marked your response Alphonse as an answer as it lead me onto the right path.

Similar Messages

  • Microsoft Access Text Driver missing! and ...Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "(null)".

    In order to use OpenRowSet, I installded Microsoft Access Database Engine 2010. However, I could not find Microsoft Access Text Driver in Drivers of ODBC Data Source Administrator.  Could I get some help with that?
    Thank you very much!

    I am local admin and try to run the following script, but I got an error. Could anyone help me look at it?
    EXEC sp_configure 'show advanced options', 1
    go
    RECONFIGURE
    GO
    EXEC sp_configure 'ad hoc distributed queries', 1
    go
    RECONFIGURE
    GO
    SELECT * FROM OPENROWSET('MSDASQL',
    'Driver={Microsoft Access Text Driver (*.txt, *.csv)};
    DefaultDir=D:\;','SELECT * FROM Test.csv')
    Configuration option 'show advanced options' changed from 1 to 1. Run the RECONFIGURE statement to install.
    Configuration option 'Ad Hoc Distributed Queries' changed from 1 to 1. Run the RECONFIGURE statement to install.
    OLE DB provider "MSDASQL" for linked server "(null)" returned message "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified".
    Msg 7303, Level 16, State 1, Line 1
    Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "(null)".

  • BusinessObjects Explorer The creation of the data source object tree failed

    Hi,
    I'm trying to create a new information space in BusinessObjects Explorer 4.0.  When I select the Universe I want to use and click "New" Information Space I get the following error.
    Failed to retrieve the data source details.
    The creation of the data source object tree failed.
    I'm just using a local installation, BI Platform 4.0, Client Tools, and Explorer are all installed on my Windows 7 machine.  It's intended to be a demo environment.
    Any guidance would be appreciated!
    Jeff

    Hi Jeff,
    first of all BI4 Enterprise is not supported on Windows 7 and it may not work properly for various reasons.
    But you can give this a try:
    Update the command line parametres of each of the Explorer Services to use a different value for the connection server libraries
    The changes are made to the command line of each of the Explorer services
    - Master
    - Exploration
    - Indexing
    - Search
    Remove the following from the command line parameters of the existing Explorer services
    -connectivity_dir "C:/Program Files (x86)/SAP BusinessObjects/SAP BusinessObjects Enterprise XI 4.0//dataAccess/connectionServer"
    Example of the original Explorer Master server command line parameters:
    -Djava.awt.headless=true -Dosgi.configuration.area=configuration.BI40.ExplorerMasterServer1 -server -XX:MaxPermSize=256m -Dosgi.clean=true -Xmx1g -jar plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20081125.jar -loggingPath "C:/Program Files (x86)/SAP BusinessObjects/SAP BusinessObjects Enterprise XI 4.0/logging/" -connectivity_dir "C:/Program Files (x86)/SAP BusinessObjects/SAP BusinessObjects Enterprise XI 4.0//dataAccess/connectionServer" -serverkind explorerMaster
    And update the server command line parameters with the following:
    "-Dbusinessobjects.connectivity.directory=C:/Program Files (x86)/SAP BusinessObjects/SAP BusinessObjects Enterprise XI 4.0//dataAccess/connectionServer"
    Example of an updated Explorer Master server command line parameters:
    -Djava.awt.headless=true -Dosgi.configuration.area=configuration.BI40.ExplorerMasterServer -server -XX:MaxPermSize=256m -Dosgi.clean=true -Xmx1g -jar plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20081125.jar -loggingPath "C:/Program Files (x86)/SAP BusinessObjects/SAP BusinessObjects Enterprise XI 4.0/logging/" -Dbusinessobjects.connectivity.directory="C:/Program Files (x86)/SAP BusinessObjects/SAP BusinessObjects Enterprise XI 4.0//dataAccess/connectionServer" -serverkind explorerMaster

  • Cannot initialize the data source object of OLE DB provider "OraOLEDB.Oracl

    I have created a linked server in a SQL Server 2005 connecting to either an Oracle Database and a SQL Server 6.5 database and getting the following error for both links when trying to query using provider OraOLEDB.Oracle, please help.
    OLE DB provider "OraOLEDB.Oracle" for linked server "finprod3" returned message "ORA-12154: TNS:could not resolve the connect identifier specified".
    Msg 7303, Level 16, State 1, Line 1
    Cannot initialize the data source object of OLE DB provider "OraOLEDB.Oracle" for linked server "finprod3".

    What version of Oracle client software are you using? 32 bit or 64 bit? Is the OS 32 bit or 64 bit?
    12154 generally means the client can't figure out what TNSNames.ora entry you're referring to, which is the part you passed as "data source" in the oledb connection. Did you configure the client? Does SQLPlus connect without issue?
    There's also a known issue where running 32 bit client software on a 64 bit OS can result in that error in some versions, due to parenthesis in the path of the executable - 32 bit apps go in Program Files (x86) on a 64 bit OS. Applying the latest patch level to the client software will resolve that issue.
    Greg

  • Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "Excel_Test"

    Here,
    I have created a Linked Server Called Excel_Test And its working fine ( For Retrieving data from excel to Sql Server Database Table ) ...
    I have written a Stored Procedure for inserting data , When i Execute that stored procedure it is inserting data to Table Which i have
    given.
    And the data which is in table should be shown in the application,
    But, Am getting the following error.
    Cannot
    initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "Excel_Test".
     Please help me on this.
     Thanks in Advance....

    Even am able to retrieve the data from Sql Server management studio.
    The same retrieved data should be shown in the application (Dashbord).
    Query : Select * from OpenQuery(Excel_Test,'Select * from [Sheet1$]')
    Am getting the output excatly the data in the excel sheet.
    But when am opening that application where the above data should be shown am getting the below error.
    Cannot
    initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "Excel_Test".
     Is this error is because of problem in Dot Net Coding or in the linked server.
    Thanks in Advance.....

  • Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "database name".

    I have an application which has linked servers to mdb databases on Sql Server. Development machines which have access to full version of Office can intialise the data source as expected, however, machines using the Office 2010 runtime throw the above exception.
    Have checked the HKEY_CLASSES_ROOT\Microsoft.ACE.OleDb.12.0\CLSID which has value {3BE7860-0366-4F5C-9434-25CF162E475E} as expected, however that CLSID cannot be found in HKEY_CLASSES_ROOT\CLSID on the machines using the runtime.
    How can I ensure PCs using the 2010 runtime can access the linked server(s).

    To add a login, execute this procedure:
    sp_addlinkedsrvlogin
    See some examples here:
    http://msdn.microsoft.com/en-us/library/ms189811.aspx

  • Report iview gets the wrong source object

    Hi
    In the Web application designer I upload a web template to a role. I upload the role to the portal.
    In the portal on the properties of the report iview; I trace the delta links and it shows me that the source object is BW 2.x/3.x Web Application iView and NOT the 7.x iview. Where can I change this, so everytime I upload a new web report, the source obejct will be the 7.x iview ?
    System: 2004s sps13
    Regards
    Steffen

    Hi
    In the Web application designer I upload a web template to a role. I upload the role to the portal.
    In the portal on the properties of the report iview; I trace the delta links and it shows me that the source object is BW 2.x/3.x Web Application iView and NOT the 7.x iview. Where can I change this, so everytime I upload a new web report, the source obejct will be the 7.x iview ?
    System: 2004s sps13
    Regards
    Steffen

  • How can I use ONE Text search iView to event/affect mutliple Result Sets?

    hello everyone,
    i have a special situation in which i have 6 flat tables in my repository which all have a common field called Location ID (which is a lookup flat to the Locations table).
    i am trying to build a page with a free-form text search iView on Table #1 (search field = Location ID).  when I execute the search, the result set for Table #1 is properly updated, but how do I also get Result Set iViews for Tables #2-6 to also react to the event from Text Search for Table #1 so that they are updated?
    i don't want to have to build 6 different text search iViews (one for each table).  i just want to use ONE text search iView for all the different result set tables.  but, in the documentation and iView properties, the text search iView doesn't have any eventing.
    if you have any suggestions, please help.
    many thanks in advance,
    mm

    hello Donna,
    that should not be a problem, since you are detailw with result sets and detail iviews because custom eventing can be defined for those iviews.
    Yes, it says "no records" found because an active search and record selection havent' been performed for it (only your main table does).
    So, yes, define a custom event, and pass the appropriate parameters and you should be fine.
    Creating a custom event between a Result Set iView and an Item Details iView is easy and works. I have done it.
    See page 35 of the Portal Content Development Guide for a step-by-step example, which is what I used.
    For my particular situation, the problem I'm having is that I want the Search Text iView's event (i.e., when the Submit button is pressed) to be published to multiple iViews, all with different tables.  Those tables all share some common fields, which is what the Search iView has, so I'd like to pass the search critera to all of the iViews.
    -mm

  • Can I pass parameters to a subquery to return a narrow result set?

    Hi-
    HERE'S WHAT I'M TRYING TO DO:
    Create a worksheet to aggregate the data that's returned from a subquery result set based on the user's specified date ranges.
    HERE'S MY PROBLEM:
    Discoverer is aggregating the data FOR EACH PARTICULAR DATE that shows up (ie-6/1, 6/2, 6/3) instead of across the entire specified date range (ie- 6/1-6/3) because the date parameters can only be applied to the main query instead of the subquery.
    In essence, I need to:
    SELECT location1, task1, sum(product1), max(product2)
    FROM
    (SELECT * FROM table1 WHERE date1 >= userSpecifiedDate1 and date1 <= userSpecifiedDate2)
    GROUP BY location1, task1
    ...but using Discoverer's "Parameters" and "Totals" tool, so far I can only get Discoverer to do this :
    SELECT location1, task1, sum(product1), max(product2), sum(product3)
    FROM
    (SELECT * FROM table1)
    WHERE date >= userSpecifiedDate1 and date <= userSpecifiedDate2
    GROUP BY location1, task1
    Is there any way to apply date parameters to the subquery first so I'm aggregating across the range and not on each date?
    Hope this makes sense. Any suggestions would be appreciated!

    Hi,
    Yes.
    You can pass parameter from search criteria to procedure.
    First u need write a method in the AmImpl java class to call the procedure.
    Like
    public void callingProcWithinParams(String sreachCriterParam)
    //pass the parameter to proc
    Then shuttle this method to client interface.

  • In accessibility option can the home key be assigned to end a telephone call?

    In accessibiility mode can I assign the home key to end a telephone call on an iphone 3gs?

    Quicksilver, free, reviewed at [http://www.macworld.com/reviews/product/526533/review/quicksilver.html] However the doing a web search for this reveals somewhat uncertain sources. There's a 10.6 version at http://www.blacktree.com/ The site looks pretty broken but the download still works.
    Second edit:
    Seeing that Quicksilver's site appears to be unsupported you might be better with the Spark recommendation. One Spark user even said they had given up on QS for Spark.

  • Failed to retrieve the data source in Business Objects Explorer

    I have built a universe with Designer suits and separate measurements of paramentros and bound by, ran on Web Intelligence, but when I try to use the Business Objects Explorer is reported the following message:
    Failed to retrieve the data source details.
    The creation of the data source object tree failed
    What should I do?

    There are two OSS notes about this error ;
    1411433
    1363777
    Also you can take a look at this service pack
    http://ftp1.businessobjects.com/outgoing/CMS/crXIwin_en_sp3.pdf
    cheers
    Tansu
    Edited by: tansu aksu on Jan 25, 2011 5:03 PM

  • How to change the index (?) (position of subforms inside other subforms) using code?

    Hi, let say I have something like this (flowed positioning):
    Main subform
         subform A
         subform B
         subform C
    And I want, by code to change them to:
    Main subform
         subform C
         subform A
         subform B
    How can I do that?
    Thanks.

    1. What is it you want to do exactly?
    Seems like you want to get the last subform, insert it at the first position and then have the subsequent subforms beneath the subform placed on first position...
    2. That's it?
    3. Can you have more subforms than only 3?
    4. Does all the three subforms has the same fields inside them?
    5. Or you just want to change the position of the flowed subforms?

  • SchemaFactory.newSchema can't be called more than one with the same sources

    I am using Java 5 or Java 6. Did you already observed such behavior? Seems a bug but I didn't find a Bug ID match.
    // Create an array of sources
    final InputStream xsd = new FileInputStream("src/xml.xsd");
    StreamSource[] sources = new StreamSource[1];
    sources[0] = new StreamSource(xsd);
    // Create the Schema Factory       
    final SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); // Create a schema
    Schema schema1 = schemaFactory.newSchema(sources);
    // Create a second schema, it will throw an Excepion
    Schema schema2 = schemaFactory.newSchema(sources);
    If you are creating a new array of sources before to create the second schema, it works fine. It seems that SchemaFactory.newSchema is making the passed sources as not "reusable"
    Thrown Exception :
    Exception in thread "main" org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'null', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
    at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaError(XSDHandler.java:2245)
    at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchema(XSDHandler.java:1590)
    at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:438)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:556)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:523)
    at com.sun.org.apache.xerces.internal.jaxp.validation.xs.SchemaFactoryImpl.newSchema(SchemaFactoryImpl.java:206)
    at javaapplication5.Main.main(Main.java:55)

    I've looked further into the matter and the problem is that the newSchema() method closes the underlying input stream, as a result of which there is no way to reuse the same source object if it is based on an input stream. There's another alternative: if it is not necessary for you to provide the schemas in an array, you can use the "newSchema(URL schema)" method. The advantage of using an URL object is that it can hold a reference to files inside a jar file.

  • Crystal report for visual studio 2010 data source object is not valid error

    Hello,
    I receive an "data source object is not valid" error when I want to print one CR document after setting an ADODB.Recordset on SetDataSource method of my report.
    On my developer station, this operation works without problem but on client station, I get this error.
    The redistributable package for client is installed on client side (CRRuntime_32bit_13_0_1.msi).
    Can someone help me?
    Thank you.

    Thank's for your answers
    Dim rsPkLst As ADODB.Recordset = Nothing
    Dim report As New crPickingList
    ' Fill ADODB.Recordset with SQL Statment
    If rsPkLst.RecordCount > 0 Then
          report.SetDataSource(rsPkLst) ' Error : The data source object is invalid
    EndIf
    This error appears during  "report.SetDataSource(rsPkLst)" instruction.
    ADODB drivers are already installed and my ADODB.Recordset is filled with good records.
    This project is an updated project from Visual Studio 2003 to Visual studio 2010 and the old version was running fine.
    Developer and client station runs under Windows XP SP3.
    On developer side I install CRforVS_13_0_1 (BuildVersion=13.0.1.220.Cortez_CR4VS).
    On client side I install CRRuntime_32bit_13_0_1.msi.
    Both stations use Microsoft .Net Framework 4.
    Move to ADO.NET is a solution but, for the moment, I do not have the time to change all applications from my company.
    (I get this error from all application updated from VS 2003 to VS 2010 developed since 2005)
    David.

  • Where is the data source configuration in Jdev 11g?

    Does anybody know where is the data source configuration in JDeveloper 11g? I want to create a JNDI data source using the database connection. Do I have to login the Integrated WLS to create the data source? Thanks.

    Hi Chris,
    Configuring the data source in Integrated WLS works for me. Thanks for your help!
    Looks 11g didn't create the data source automatically in the App Navigator. I checked the deployed application directory - "Application Data\JDeveloper\system11.1.1.2.36.55.36\o.j2ee\drs\TestDS\adf\META-INF" and "Application Data\JDeveloper\system11.1.1.2.36.55.36\o.j2ee\drs\TestDS\META-INF". I didn't find the data source file - data-sources.xml. Then I started the web application and checked the Context, I can only find the data source which I defined in the Integrated WLS. It is interesting that 11g removed the JNDI list from the RMI bindings.
    Also thanks to Nick for the information. We are migrating a Spring Framework application to Oracle and don't use ADF Business Components in this project.
    Huaichen

Maybe you are looking for