On Thu, 27 Nov 2003 06:22:50 -0800, <(E-Mail Removed)> wrote:
¤ Hi
¤
¤ I'm trying to use stored procedures held in Access and as
¤ soon as try to execute the command (using ExecuteReader) I
¤ get the error message:
¤ Multiple-step OLE DB operation generated errors. Check
¤ each OLE DB status value, if available. No work was done.
¤
¤ My code is:
¤
¤ OleDbConnection myConnection = null;
¤ OleDbDataReader myReader = null;
¤
¤ myConnection = new OleDbConnection
¤ (ConfigurationSettings.AppSettings["ConnectionString"]);
¤
¤ OleDbCommand myCommand = new OleDbCommand
¤ ("SELECTTEST",myConnection);
¤
¤ myCommand.CommandType=CommandType.StoredProcedure;
¤
¤ OleDbParameter parameterTask=new OleDbParameter
¤ ("@TASK_NAME",OleDbType.VarChar,15);
¤ parameterTask.Direction = ParameterDirection.Output;
¤ myCommand.Parameters.Add(parameterTask);
¤
¤ OleDbParameter parameterDescription=new OleDbParameter
¤ ("@TASK_DESCRIPTION",OleDbType.VarChar,15);
¤ parameterDescription.Direction = ParameterDirection.Output;
¤ myCommand.Parameters.Add(parameterDescription);
¤
¤ OleDbParameter parameterProject=new OleDbParameter
¤ ("@PROJECT_NAME",OleDbType.VarChar,15);
¤ parameterProject.Direction = ParameterDirection.Output;
¤ myCommand.Parameters.Add(parameterProject);
¤
¤ myConnection.Open();
¤ myReader = myCommand.ExecuteReader();
¤ myConnection.Close();
¤
¤ "SELECTTEST" is held in Access and is "SELECT
¤ TASK.TASK_NAME,TASK.TASK_DESCRIPTION,PROJECT_NAME FROM
¤ TASK" and the TASK table only has these fields.
¤
¤ Any ideas what I'm doing wrong?
¤ Thanks in advance.
I don't see any output parameters defined in your Access QueryDef. From what I can see you don't
need them if you're returning a resultset to the DataReader. Otherwise the code looks OK to me.
Remove the parameter code and see if it makes any difference.
Paul ~~~
(E-Mail Removed)
Microsoft MVP (Visual Basic)