Last post May 18, 2010 09:54 AM by hans_v
May 18, 2010 06:08 AM|raj_june27|LINK
hi guys....can we write stored procedures in ms-access 2007...if possible how?
May 18, 2010 09:28 AM|hans_v|LINK
No, in Access Stored pocedures are not supported. You can only create single SQL statement and store them as Saved Query. In .NET, you can use those query just like Stored Procedures
May 18, 2010 09:45 AM|vishwaraj1|LINK
stored procedure can not be created in access 2007. you will have to use sql query for this.
if you want the syntax for this this is below:
OleDbConnection con=new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" + HttpContext.Current.Server.MapPath("App_data\\yourdb.mdb"));
if (con.State == ConnectionState.Open)
OleDbCommand cmd = new OleDbCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "insert into tablename (columnname1) values (@Type)";
cmd.Parameters.Add(new OleDbParameter("@Type", "Bnr"));
May 18, 2010 09:54 AM|hans_v|LINK
stored procedure can not be created in access 2007
you will have to use sql query for this.
Like I said, you can use saved queries like they are a Stored Procedure
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "name of saved query";