I am developping with Visual Studio 2003 + C# + MySQL 4.1 and the OleDb
components. My problem is that a stament using the COMPRESS() function seems
to work or not depending on the data ...
Here is the code:
OleDbCommand catCMD = DatabaseConnection.CreateCommand();
catCMD.CommandText = "INSERT INTO MyTable (id,msg) VALUES (88,COMPRESS(?));"
OleDbParameter p = catCMD.CreateParameter();
p.ParameterName = "msg";
p.OleDbType = OleDbType.VarChar;
p.Value = MyRawHTML; // string containing the text on a web page
catCMD.Parameters.Add(p);
catCMD.ExecuteNonQuery();
the 'msg' column is defined as 'BLOB';
This will generate an exception or not depending on the contents of
myRawHTML ... the error is E_ERRORSINCOMMAND
Who or what even looks at the input string and why should its contents be
considered an error in the command's syntax??? Should I be using another
type than VarChar?
This is very annoying - so now I changed my code to catch the exception and,
if so, store everything but the message data - which happens in about 1/3 of
the cases for what I am processing ...
By the way: I am using an Ole DB provider for MySQL which I found on
www.MySQL.com, but it was written in 2001 and I am wondering if it could be
the source of my many problems. Any OLE DB MySQL developer out there who can
help make a recommendation?
Thanks,
Patrick