Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems calling Stored Procedure in Access

Status
Not open for further replies.

Kalisto

Programmer
Feb 18, 2003
997
GB
Hi, I have a simple 'sproc' in access. If I run it from access it runs fine.

If I call the same code as a command string from my .net application it also runs and returns the values I'd expect.

If I use the code below to create a parameter set, in an attempt to call as a sproc, then I get the error
"Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done"

I have checked that all the sizes and datatypes match, so any more ideas?

Code:
OleDbParameter p = new OleDbParameter("loginName",OleDbType.VarChar,15);
p.Direction = ParameterDirection.Input;
p.Value = tbLoginName.Text;
parameters[0] = p;
		
p = new OleDbParameter("password",OleDbType.VarChar,15);
p.Direction = ParameterDirection.Input;
p.Value = tbPassword.Text;
parameters[1] = p;

p = new OleDbParameter("roles",OleDbType.VarChar,50);
p.Direction = ParameterDirection.Output;
parameters[2] = p;

p = new OleDbParameter("guid",OleDbType.Char,36);
p.Direction = ParameterDirection.Output;
parameters[3] = p;
 
I'm not really sure what the problem is (as I try to stay clear of MS Access for any web application) but this article may give you some clues as it includes a simple demo:



____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.
 
Thanks, I got to the bottom of it, it was because I was using output parameters. As soon as I commented those out it worked like a dream.

And FWIW I agree, but the client is on a shoestring, so they say access, I say Oh ok...

Cheers

K
 
Oh ok.

There are actually other free databases that work much better if you are looking for a free db (SQL Server Express for example)


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top