insert data from stored procedure into local access 2003 table

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter Neumaier

    #1

    insert data from stored procedure into local access 2003 table

    Hi,

    I am trying to select some data through a stored procedure and would
    like to store the result in a local access table. Is that possible? Can
    somebody provide an example?

    Thanks&regards!
    Peter

  • Keith Wilby

    #2
    Re: insert data from stored procedure into local access 2003 table

    "Peter Neumaier" <Peter.Neumaier @gmail.com> wrote in message
    news:1150094932 .238539.127030@ f6g2000cwb.goog legroups.com...[color=blue]
    > Hi,
    >
    > I am trying to select some data through a stored procedure and would
    > like to store the result in a local access table. Is that possible? Can
    > somebody provide an example?
    >
    > Thanks&regards!
    > Peter
    >[/color]

    What do you mean by "stored procedure"? Are you running code? More info
    required. :-)

    Keith.



    Comment

    • Peter Neumaier

      #3
      Re: insert data from stored procedure into local access 2003 table

      Sry for the confusion, thought that it was clear enough ....

      I am running a stored procedure on a sybase server and need the results
      from the stored procedure in a local access table.

      Is it possible to run the stored procedure from Access and insert the
      result from the stored procedure into a local table?

      Please let me know if you need further details...

      thx&regards!

      Keith Wilby wrote:[color=blue]
      > "Peter Neumaier" <Peter.Neumaier @gmail.com> wrote in message
      > news:1150094932 .238539.127030@ f6g2000cwb.goog legroups.com...[color=green]
      > > Hi,
      > >
      > > I am trying to select some data through a stored procedure and would
      > > like to store the result in a local access table. Is that possible? Can
      > > somebody provide an example?
      > >
      > > Thanks&regards!
      > > Peter
      > >[/color]
      >
      > What do you mean by "stored procedure"? Are you running code? More info
      > required. :-)
      >
      > Keith.
      > www.keithwilby.com[/color]

      Comment

      • Terry Kreft

        #4
        Re: insert data from stored procedure into local access 2003 table

        Yes it is.

        You create your local table
        You create a passthrough query to run your SPROC make sure the
        ReturnsRecords property is true.
        Then you use the passthrough query in an append query to append to your
        local table.

        Or
        You create a passthrough query to run your SPROC make sure the
        ReturnsRecords property is true.
        Then you use the passthrough query in a make table query to create your
        local table.



        --

        Terry Kreft


        "Peter Neumaier" <Peter.Neumaier @gmail.com> wrote in message
        news:1150094932 .238539.127030@ f6g2000cwb.goog legroups.com...[color=blue]
        > Hi,
        >
        > I am trying to select some data through a stored procedure and would
        > like to store the result in a local access table. Is that possible? Can
        > somebody provide an example?
        >
        > Thanks&regards!
        > Peter
        >[/color]


        Comment

        • Peter Neumaier

          #5
          Re: insert data from stored procedure into local access 2003 table

          Hi Terry,

          thx for the mail. Could you please provide some coded example?

          Thx&regards,
          Peter


          Terry Kreft wrote:[color=blue]
          > Yes it is.
          >
          > You create your local table
          > You create a passthrough query to run your SPROC make sure the
          > ReturnsRecords property is true.
          > Then you use the passthrough query in an append query to append to your
          > local table.
          >
          > Or
          > You create a passthrough query to run your SPROC make sure the
          > ReturnsRecords property is true.
          > Then you use the passthrough query in a make table query to create your
          > local table.
          >
          >
          >
          > --
          >
          > Terry Kreft
          >
          >
          > "Peter Neumaier" <Peter.Neumaier @gmail.com> wrote in message
          > news:1150094932 .238539.127030@ f6g2000cwb.goog legroups.com...[color=green]
          > > Hi,
          > >
          > > I am trying to select some data through a stored procedure and would
          > > like to store the result in a local access table. Is that possible? Can
          > > somebody provide an example?
          > >
          > > Thanks&regards!
          > > Peter
          > >[/color][/color]

          Comment

          • Terry Kreft

            #6
            Re: insert data from stored procedure into local access 2003 table

            Well there isn't really any code.

            Asumng you have pubs database on SQL Server

            Create a new query
            Cancel the tables dialog box
            Go to the Query menu and choose PassThrough
            Put the SQL in
            SELECT * from authors
            Open the properties dialog and enter a valid ODBC connection string
            Test the query and save when it works (qPassThrough)

            Create a new query
            Select qPassThrough from the dialog
            Add all the fields to the grid
            Go to the Query menu and choos Make Table
            Enter a name for the new table (dbo_authors)
            Run the query (you can check the SQL to see what is produced)
            Save the Query (qmDbo_Authors)

            Check the dbo_authors table has been created

            VBA code to run this then becomes something like

            Function MakeDbo_Authors ()
            Dim db As DAO.Database
            Dim qdf As DAO.QueryDef

            Set db = CurrentDb
            Set qdf = db.QueryDefs("q mDbo_Authors")
            qdf.Execute

            Set qdf = Nothing
            Set db = Nothing
            End Function



            --

            Terry Kreft


            "Peter Neumaier" <Peter.Neumaier @gmail.com> wrote in message
            news:1150245609 .837848.175340@ i40g2000cwc.goo glegroups.com.. .[color=blue]
            > Hi Terry,
            >
            > thx for the mail. Could you please provide some coded example?
            >
            > Thx&regards,
            > Peter
            >
            >
            > Terry Kreft wrote:[color=green]
            > > Yes it is.
            > >
            > > You create your local table
            > > You create a passthrough query to run your SPROC make sure the
            > > ReturnsRecords property is true.
            > > Then you use the passthrough query in an append query to append to[/color][/color]
            your[color=blue][color=green]
            > > local table.
            > >
            > > Or
            > > You create a passthrough query to run your SPROC make sure the
            > > ReturnsRecords property is true.
            > > Then you use the passthrough query in a make table query to create[/color][/color]
            your[color=blue][color=green]
            > > local table.
            > >
            > >
            > >
            > > --
            > >
            > > Terry Kreft
            > >
            > >
            > > "Peter Neumaier" <Peter.Neumaier @gmail.com> wrote in message
            > > news:1150094932 .238539.127030@ f6g2000cwb.goog legroups.com...[color=darkred]
            > > > Hi,
            > > >
            > > > I am trying to select some data through a stored procedure and would
            > > > like to store the result in a local access table. Is that possible?[/color][/color][/color]
            Can[color=blue][color=green][color=darkred]
            > > > somebody provide an example?
            > > >
            > > > Thanks&regards!
            > > > Peter
            > > >[/color][/color]
            >[/color]


            Comment

            • Peter Neumaier

              #7
              Re: insert data from stored procedure into local access 2003 table

              thx a lot!

              Terry Kreft wrote:[color=blue]
              > Well there isn't really any code.
              >
              > Asumng you have pubs database on SQL Server
              >
              > Create a new query
              > Cancel the tables dialog box
              > Go to the Query menu and choose PassThrough
              > Put the SQL in
              > SELECT * from authors
              > Open the properties dialog and enter a valid ODBC connection string
              > Test the query and save when it works (qPassThrough)
              >
              > Create a new query
              > Select qPassThrough from the dialog
              > Add all the fields to the grid
              > Go to the Query menu and choos Make Table
              > Enter a name for the new table (dbo_authors)
              > Run the query (you can check the SQL to see what is produced)
              > Save the Query (qmDbo_Authors)
              >
              > Check the dbo_authors table has been created
              >
              > VBA code to run this then becomes something like
              >
              > Function MakeDbo_Authors ()
              > Dim db As DAO.Database
              > Dim qdf As DAO.QueryDef
              >
              > Set db = CurrentDb
              > Set qdf = db.QueryDefs("q mDbo_Authors")
              > qdf.Execute
              >
              > Set qdf = Nothing
              > Set db = Nothing
              > End Function
              >
              >
              >
              > --
              >
              > Terry Kreft
              >
              >
              > "Peter Neumaier" <Peter.Neumaier @gmail.com> wrote in message
              > news:1150245609 .837848.175340@ i40g2000cwc.goo glegroups.com.. .[color=green]
              > > Hi Terry,
              > >
              > > thx for the mail. Could you please provide some coded example?
              > >
              > > Thx&regards,
              > > Peter
              > >
              > >
              > > Terry Kreft wrote:[color=darkred]
              > > > Yes it is.
              > > >
              > > > You create your local table
              > > > You create a passthrough query to run your SPROC make sure the
              > > > ReturnsRecords property is true.
              > > > Then you use the passthrough query in an append query to append to[/color][/color]
              > your[color=green][color=darkred]
              > > > local table.
              > > >
              > > > Or
              > > > You create a passthrough query to run your SPROC make sure the
              > > > ReturnsRecords property is true.
              > > > Then you use the passthrough query in a make table query to create[/color][/color]
              > your[color=green][color=darkred]
              > > > local table.
              > > >
              > > >
              > > >
              > > > --
              > > >
              > > > Terry Kreft
              > > >
              > > >
              > > > "Peter Neumaier" <Peter.Neumaier @gmail.com> wrote in message
              > > > news:1150094932 .238539.127030@ f6g2000cwb.goog legroups.com...
              > > > > Hi,
              > > > >
              > > > > I am trying to select some data through a stored procedure and would
              > > > > like to store the result in a local access table. Is that possible?[/color][/color]
              > Can[color=green][color=darkred]
              > > > > somebody provide an example?
              > > > >
              > > > > Thanks&regards!
              > > > > Peter
              > > > >[/color]
              > >[/color][/color]

              Comment

              Working...