Re: Execute Queries in VisualBasic 6.0
From: Lars-Erik Aabech (larserik_at_newsgroup.nospam)
Date: 12/17/04
- Next message: Roel Schreurs: "PLS-00306 when calling an Oracle package procedure through a private synonym that returns a cursor."
- Previous message: Gérard Leclercq: "Re: MS Access Query"
- In reply to: M. R.: "Execute Queries in VisualBasic 6.0"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 17 Dec 2004 14:00:38 +0100
Hi!
Use an ADODB.Command object. I'm not sure if the Query objects in Access
corresponds to cmd.CommandType adCmdStoredProc or adCmdText (or another
type), the default is adCmdText. Then you set the parameters using the
cmd.Parameters collection, or you can pass them using an array to the
cmd.Execute() method.
Ex:
dim cn as Connection
dim cmd as Command
set cn = new Connection
cn.open...
set cmd.ActiveConnection = cn
cmd.CommandType = adCmdText ' or adCmdStoredProc
cmd.CommandText = "TheQuery"
cmd.Execute , Array(param1, param2)
' You can pass a ref to a long in the first param of the method to get
numbers of records affected
GL!
Lars-Erik
"M. R." <Ma.Riederer@t-online.de> wrote in message
news:eLDkAPD5EHA.2316@TK2MSFTNGP15.phx.gbl...
> Hi everyone,
>
> hope i can get an expert advise for my problem.
>
> I would like to open or execute Queries which are already in
> a MS-Access Database from the Visual Basic Code.
>
> The connection to the Database already exists and works for storing
> data and read data from the database tables or queries.
>
> Which commands or parameters do i need to execute a query over ADO ?
>
>
> Best regards
>
> Matthias Riederer
>
>
- Next message: Roel Schreurs: "PLS-00306 when calling an Oracle package procedure through a private synonym that returns a cursor."
- Previous message: Gérard Leclercq: "Re: MS Access Query"
- In reply to: M. R.: "Execute Queries in VisualBasic 6.0"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|