VBA-code to run a sql-script

  • Thread starter Thread starter Filips Benoit
  • Start date Start date
F

Filips Benoit

Dear All,

I'm looking for a VBA-code to run a sql-sript from the Access.adp-interface
Thanks,
Filip
 
Dim CmdFill As adodb.Command
Set CmdFill = New adodb.Command
Set CmdFill.ActiveConnection = CurrentProject.Connection
CmdFill.CommandType = adCmdStoredProc
CmdFill.CommandText = "sp_my_stored_proc"
CmdFill.Parameters.Item("@SomeInputParam").Value = strSomeString
CmdFill.Execute

or

Dim CmdFill As adodb.Command
Set CmdFill = New adodb.Command
Set CmdFill.ActiveConnection = CurrentProject.Connection
CmdFill.CommandText = "insert into t_person values ('some','one')"
CmdFill.Execute

If this isn't what you had in mind, we're going to need a lot more details
perhaps with sample code of what you're trying to accomplish. HTH.

Mark
 
I'd like to run a stored procedure residing in adp but trieggered in an mdb.
Is that possible?
 
Back
Top