S
schick
Posted this to 'ado' group earlier but getting no replies...
I have a C# app that uses the base "System.Data" interfaces so it can
switch between Oledb and Odbc (mostly accessing a Jet database).
Everything has worked until I tried using parameters. The code below
works perfectly in Oledb mode, but fails under Odbc. The Odbc error is
"ERROR [07002] [Microsoft][ODBC Microsoft Access Driver] Too few
parameters". Is there something I missed that the Odbc Access driver
needs but the Oledb driver doesn't?
// create cmd and open connection
byte[] data = GetData();
cmd.CommandText = "UPDATE ImageTable SET " +
"fFolderInfoArray=@FIA " +
"WHERE fImageId=10;";
IDbDataParameter param = cmd.CreateParameter();
param.DbType = System.Data.DbType.Binary;
param.Size = data.Length;
param.Value = data;
param.ParameterName = "@FIA";
cmd.Parameters.Add(param);
cmd.ExecuteNonQuery();
Thanks,
Brad
I have a C# app that uses the base "System.Data" interfaces so it can
switch between Oledb and Odbc (mostly accessing a Jet database).
Everything has worked until I tried using parameters. The code below
works perfectly in Oledb mode, but fails under Odbc. The Odbc error is
"ERROR [07002] [Microsoft][ODBC Microsoft Access Driver] Too few
parameters". Is there something I missed that the Odbc Access driver
needs but the Oledb driver doesn't?
// create cmd and open connection
byte[] data = GetData();
cmd.CommandText = "UPDATE ImageTable SET " +
"fFolderInfoArray=@FIA " +
"WHERE fImageId=10;";
IDbDataParameter param = cmd.CreateParameter();
param.DbType = System.Data.DbType.Binary;
param.Size = data.Length;
param.Value = data;
param.ParameterName = "@FIA";
cmd.Parameters.Add(param);
cmd.ExecuteNonQuery();
Thanks,
Brad