Thread
:
Import Access records to excel (parameter is a called funct) v.20
View Single Post
#
15
Posted to microsoft.public.excel.programming
Myrna Larson
external usenet poster
Posts: 863
Import Access records to excel (parameter is a called funct) v.20
I don't know the answer to your question as to "Why". I think that using the
question marks, particularly if there's more than one parameter, obfuscates
the code.
On 27 Sep 2004 01:08:22 -0700,
(Jamie Collins) wrote:
Myrna Larson wrote ...
Thanks for your comments, particularly your suggestion re a more efficient
method for my particular case. I'll try it. That's for the RS.Open
statement,
right?
Yes, you can use EXECUTE syntax in RS.Open's Source argument
FWIW, it took me 2-3 days of digging into books and the MS Knowledge Base
to
get the syntax for executing a procedure with parameters!
I agree the Command/Parameters syntax is not particularly intuitive
which is probably one reason I avoid using it, but my main reason is
that I can't help but wonder if all the jumping through hoops merely
results in an EXECUTE statement being passed to the provider anyhow,
so I may as well write that EXECUTE statement myself.
Are the parameter
values assigned to the question mark placeholders in the order that you
added
them to the parameters collection? Or can't you use the question mark when
there's more than one parameter?
I don't know the answer to that one because I don't use question mark
placeholders. What is the advantage over using named arguments? e.g.
CREATE PROCEDURE
MyStoredProc (
start_date DATETIME,
end_date DATETIME
)
AS
SELECT
RefID,
DateEffective,
Earnings
FROM
EarningsHistory
WHERE
DateEffective
BETWEEN start_date AND end_date
;
Jamie.
Reply With Quote
Myrna Larson
View Public Profile
Find all posts by Myrna Larson