Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / SQL Server / ADP / August 2004

Tip: Looking for answers? Try searching our database.

Store procedure com ADO

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alejandro - 05 Aug 2004 03:44 GMT
I m trying to run this code , but i dont know how insert the parameters of
the store procedure, someone can help with this????

This is the code of the form:

Option Compare Database
Option Explicit
Public cn As ADODB.Connection

Private Sub Comando10_Click()

Dim inserta As ADODB.Command
Set cn = CurrentProject.Connection
Set inserta = New ADODB.Command
Set inserta.ActiveConnection = cn

inserta.CommandText = "inse1"
inserta.CommandType = adCmdStoredProc

inserta.Execute

and this is the code of the store procedure :

ALTER    proc inse1  @conta int, @valor money as
insert xfinanceiro(conta, valor)
select @conta, @valor

How i can insert the parameters @conta and @valor ???

Thanks Alejandro
Malcolm Cook - 05 Aug 2004 16:30 GMT
look at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdmt
happend.asp


then write code like

with inserta
   .Parameters.Append .CreateParameter("@param_uno", adVarChar, , 20,"first
param value")
   .Parameters.Append .CreateParameter("@param_dos", adVarChar, ,
20,"second param value")
   .execute
end with

> I m trying to run this code , but i dont know how insert the parameters of
> the store procedure, someone can help with this????
[quoted text clipped - 26 lines]
>
> Thanks Alejandro
- 29 Aug 2004 15:58 GMT
inserta.parameters.refresh
inserta.parameteres(1).value = "abc"
or
inserta.parameters("@conta").value = "abc"

>-----Original Message-----
>I m trying to run this code , but i dont know how insert the parameters of
[quoted text clipped - 29 lines]
>
>.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.