How do I create a procedure in VB code to execute multiple sql statements. I'm using ODBC to connect to an Access DB.
I am able to execute sql statements but I don't know the Syntax for creating procedures.
Thanks
Printable View
How do I create a procedure in VB code to execute multiple sql statements. I'm using ODBC to connect to an Access DB.
I am able to execute sql statements but I don't know the Syntax for creating procedures.
Thanks
What do you mean by "creating procedures"??? Are you saying that you want to know how to execute multiple SQL statements in a row? I'm just confused as to what you mean.
I need to create a procedure that will preform some calculations as well as execute about 40 sql statments all at once in MS-Access. Something like 'Create or Replace (procedure name)' in PL/Sql
Well, I'm using ADO to access my database(it's Sybase SQL Server) and the way I do it is this:
Connection.Execute ("SQL Statement Here")
so you can just enter all of your SQL statements like that and have them execute that way.
But as far as how to create and perform calculations, I can't really help you until you give me some more information. Like, what calculations do you need to perform.
Thats how I'm doing it right now. I thought there might be an easier way. If I was using Oracle I could do it but I need to use Access.
Thanks for you help
There are no stored procedures in MS Access.... but you can create a query in MS Access that does what you want, then in VB you can open that as a recordset (just like you would with a table or executing an SQL statement)