ADO data shaping w/ stored procedures

Results 1 to 2 of 2

Thread: ADO data shaping w/ stored procedures

  1. #1
    Join Date
    Dec 1969

    Default ADO data shaping w/ stored procedures

    Any recommendations for a good data shaping reference? <BR><BR>My problem is that I would like to use a stored procedure to get the parent recordset, then shape several children recordsets off of it. But you can&#039;t re-shape and add columns. <BR><BR>An example based on the pubs database in SQL Server: <BR><BR>Create a stored procedure to select all of the rows in the table titles. It could be as simple as; SELECT * FROM titles. <BR><BR>Now the shaping <BR>Dim strShape2 <BR>strShape2 = "SHAPE ???? AS rstTitles " &_ <BR>"APPEND ({SELECT * FROM titleauthor} " &_ <BR>"RELATE title_id TO title_id) AS rstAuthors" <BR><BR><BR>What works for ???? <BR>of course "SELECT * FROM tables" works. But that does not address my problem I would like to use a parametized stored procedure.<BR><BR>I have not figured out how to call a stored procedure inside of the shape command. <BR><BR>I can use a command object to call the stored procedure and create a recordset but I can not reshape the recordset to add child columns once the parent recordset has been created.<BR><BR>I wonder if I should create the shaped recordset first with a data provider of "none" then somehow populate the shaped recordset with data from the database.<BR><BR>Any ideas?

  2. #2
    Aquarius Guest

    Default RE: ADO data shaping w/ stored procedures

    In general, you can&#039;t use a stored procedure in place of a table name like you can a query in SQLServer7. So you can, say, do "select * from tablename", or "select * from (select foo from bar)", because a query can be used as a table. This bites me *all* the time -- you could insert the output from your stored procedure into a temporary table and then select * from it? You can&#039;t do this with a stored procedure in SQLServer7, at least -- since I can&#039;t find a SHAPE command in SQLServer T-SQL, I&#039;m assuming that you&#039;re not using it...<BR><BR>Aq.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts