Showing posts with label compact. Show all posts
Showing posts with label compact. Show all posts

Thursday, March 29, 2012

Error when updating bigint columns using ADO

I am attempting to write a conversion of our product for Compact Edition; we already provide it based on SQL Server. The database interface uses ADO through a Python-win32com adaptor, and has worked fine so far. (Note: *not* ADO.net, just plain old COM)

Now, a curious thing happens. When inserting new data through a Recordset, everything works fine - except for columns defined as bigint. There are no exceptions thrown, but when you read the columns back they contain nothing but zeroes. Do the same to any other column type - I've tried integer, numeric, float, nvarchar and ntext so far, and they all seem to work just fine. It does not seem to be conversion-related either, since I've tested the exact same data to various column types. And using bigint on regular SQL Server works just fine.

The code involved is quite unspectacular, and simply switching the column types to integer would solve the immediate problem, but causes potential future issues since we normally store internal IDs in bigint columns, and the values may grow quite large.
This may indicate a problem with compatibility betweeen the 3rd party python ADO adaptor and the SQL CE OLEDB provider.

Wednesday, March 7, 2012

Error using Verify/Repair methods of SqlCeEngine

I have a compact pc program that uses a sql server database (sdf file).
I want to check the database integrity when program starts so I added a call to veriy method of SqlCeEngine.

The verify function always returns false even the database is OK and I can work with it.

when I call repair it throws the exception : "The specified module could not be found"

The code is :

string connectionString = "Data Source = '" + m_dbFullName + "'";

SqlCeEngine engine = new SqlCeEngine(connectionString);

if(engine.Verify() == false)

{

engine.Repair(null, RepairOption.RecoverCorruptedRows);

}

The database exists and the path to it is correct:

dbFullName = "\\program files\\MyApp\\MyDB.sdf"

I also tried out some different connection strings but it did not help:

"Data Source = ' MyDB.sdf '"

"Data Source = 'MyDB.sdf "

"Data Source=' MyDB.sdf '"

"Data Source=MyDB.sdf"

Please any one can help me with this ?

I have the same problem...