[AccessD] Executing Stored Procedures in a A2K ADP?

Joe Rojas JRojas at tnco-inc.com
Fri May 7 09:48:03 CDT 2004


Ah! This is what I was looking for!
Thanks for the info.

Does anyone have an argument for not using this method as oppose to my
example below?

Thanks!
JR

-----Original Message-----
From: Brett Barabash [mailto:BBarabash at tappeconstruction.com]
Sent: Friday, May 07, 2004 9:57 AM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] Executing Stored Procedures in a A2K ADP?

One of the coolest features about ADO is that you can call stored procedures
just like built-in methods:

With CurrentProject.Connection
    .sp_DeleteRAs RANum
End With

If you want to open up a recordset based off of a stored procedure, you can
do the following:

Dim rs As Recordset
Set rs = New Recordset

With CurrentProject.Connection
    .sp_GetCustomerList MyAcctNo, rs
End With

-----Original Message-----
From: Mackin, Christopher [mailto:CMackin at quiznos.com]
Sent: Friday, May 07, 2004 8:47 AM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] Executing Stored Procedures in a A2K ADP?


There are other ways, in my opinion this is the best though, except for the
breaking out of the creation of the paramter and asigning it in another
line, you can set the value of the paramter when you create it.

.Parameters.Append .CreateParameter("@RANum", adVarChar, adParamInput, 25,
RANum)

-Chris Mackin

-----Original Message-----
From: Joe Rojas [mailto:JRojas at tnco-inc.com]
Sent: Friday, May 07, 2004 7:11 AM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Executing Stored Procedures in a A2K ADP?


Hi All,

I am working on an A2k ADP with a SS7 BE.

When executing stored procedures, both with and without parameters, I create
and ADO Command object to do this.
For example,

Set com = New ADODB.Command
With com
.ActiveConnection = CurrentProject.Connection
          .CommandText = "dbo.sp_DeleteRAs"
          .CommandType = adCmdStoredProc
          .Parameters.Append .CreateParameter("@RANum", adVarChar,
adParamInput, 25)
          .Parameters("@RANum") = RANum
          .Execute
End With

Does A2K, when working with ADPs, have a more direct/better way of executing
stored procedures from code or this the only/best way to do this?

Thanks,
JR


----------------------------------------------------------------------------
----------------------------------------
The information in this email may contain confidential information that
is legally privileged. The information is only for the use of the intended
recipient(s) named above. If you are not the intended recipient(s), you
are hereby notified that any disclosure, copying, distribution, or the
taking
of any action in regard to the content of this email is strictly prohibited.
If
transmission is incorrect, unclear, or incomplete, please notify the sender
immediately. The authorized recipient(s) of this information is/are
prohibited
from disclosing this information to any other party and is/are required to
destroy the information after its stated need has been fulfilled.

Any views expressed in this message are those of the individual
sender, except where the sender specifies and with authority,
states them to be the views of Tappe Construction Co.

This footer also confirms that this email message has been scanned
for the presence of computer viruses.Scanning of this message and
addition of this footer is performed by SurfControl E-mail Filter software
in conjunction with virus detection software.

--
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



This electronic transmission is strictly confidential to TNCO, Inc. and
intended solely for the addressee. It may contain information which is
covered by legal, professional, or other privileges. If you are not the
intended addressee, or someone authorized by the intended addressee to
receive transmissions on behalf of the addressee, you must not retain,
disclose in any form, copy, or take any action in reliance on this
transmission. If you have received this transmission in error, please notify
the sender as soon as possible and destroy this message. While TNCO, Inc.
uses virus protection, the recipient should check this email and any
attachments for the presence of viruses. TNCO, Inc. accepts no liability for
any damage caused by any virus transmitted by this email.



More information about the AccessD mailing list