S
StuckNovice
I asked this question previously on the external data
group and was referred to use DAO, but being a Stuck
Novice I am not sure how.
I have a SQL stored procedure that returns data (if I run
it interactively). I currently run this as a pass-thru
query and can see the data returned. But the SP needs a
date parameter (which changes) and pass-thru queries don't
allow 'dynamic' parameters. Thus I 'need' to build the
appropriate query string in VBA (based on user input) and
run the procedure. Of course I am a pure novice and not a
professional DBA so I can quickly get in over my head.
That part I (feel I) understand. But what I need to do is
take the data returned from SQL and 'move it' into an
Access table (BTW, I am using Access 2000). I have
been 'successful' at getting the SQL data into a
recordset, but the only way I know how to move data from a
recordset to a table is to loop through the records
transferring field by field. That is both 'ugly' and way
too slow.
I know there is a better way to connect the SQL
data 'directly' to an Access table (or that is what has
been told to me.) But I don't have much of a clue on how
to do it. While I am reasonably proficient in writing code
(but coming from an old FORTRAN world) and I can usually
grind my way through sql. As a side note, my install of
Access also has an error so I can't get to most of the DAO
(or ADO) help. I realize this is a known issue but the fix
hasn't worked on my machine, so I am even more handicapped
in trying to get help from Access/DAO.
Can someone provide a boost in how to use DAO/VBA to get
the results from the SQL SP into an Access table?
TIA,
Stuck
group and was referred to use DAO, but being a Stuck
Novice I am not sure how.
I have a SQL stored procedure that returns data (if I run
it interactively). I currently run this as a pass-thru
query and can see the data returned. But the SP needs a
date parameter (which changes) and pass-thru queries don't
allow 'dynamic' parameters. Thus I 'need' to build the
appropriate query string in VBA (based on user input) and
run the procedure. Of course I am a pure novice and not a
professional DBA so I can quickly get in over my head.
That part I (feel I) understand. But what I need to do is
take the data returned from SQL and 'move it' into an
Access table (BTW, I am using Access 2000). I have
been 'successful' at getting the SQL data into a
recordset, but the only way I know how to move data from a
recordset to a table is to loop through the records
transferring field by field. That is both 'ugly' and way
too slow.
I know there is a better way to connect the SQL
data 'directly' to an Access table (or that is what has
been told to me.) But I don't have much of a clue on how
to do it. While I am reasonably proficient in writing code
(but coming from an old FORTRAN world) and I can usually
grind my way through sql. As a side note, my install of
Access also has an error so I can't get to most of the DAO
(or ADO) help. I realize this is a known issue but the fix
hasn't worked on my machine, so I am even more handicapped
in trying to get help from Access/DAO.
Can someone provide a boost in how to use DAO/VBA to get
the results from the SQL SP into an Access table?
TIA,
Stuck