Losing stored procedure value when using Access

  • Thread starter Thread starter Eldon Ferran de Pol
  • Start date Start date
E

Eldon Ferran de Pol

Hi all,

I very rarely use access these days as I'm more used to
SQL Server 2000. For some reason when calling an Access
stored procedure which is effectively an update statement
using the OLEDBCommand.ExecuteNonQuery, I'm losing the
value being passed in on a VARChar column. The update
query is definately firing but the value I'm passing in is
being overwritten with a 0.

Any ideas at all as I spent ages on this now,

Cheers,

Eldon
 
Hi Eldon,

I know that there is some weird behaviour when you execute same sp more than
once (Access).
It uses only first set of parameters.

It this is not the case, how is your sp declared and how is the command
declared?
 
Eldon said:
I very rarely use access these days as I'm more used to
SQL Server 2000. For some reason when calling an Access
stored procedure which is effectively an update statement
using the OLEDBCommand.ExecuteNonQuery, I'm losing the
value being passed in on a VARChar column. The update
query is definately firing but the value I'm passing in is
being overwritten with a 0.

Eldon,
Make sure you are using the correct DataType in your
OLEDB command parameters.
http://www.able-consulting.com/ADODataTypeEnum.htm

Also, make sure you have the correct parameters defined
within Access for your Update (Query | Parameters menu)

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP

Hire top-notch developers at
http://www.able-consulting.com
 
One other thing, named parameters are ignored when you use the OLEDB provider - parameters are
evaluated (mapped to the QueryDef parameters) according to their ordinal position in the Parameters
collection.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Back
Top