Hi.

I am using VS2005 to create an app for WM5. I use OLE DB to access a SQL
Mobile 3 database.

I am really a beginner when it comes to OLE DB (having worked a lot with
ADO before), but I have managed to run SQL statements successfully, and
are now trying to read data. I create a rowset based on a SELECT
statement. In one case I select from a simple table with two fields, and
that works great. But if I select from a table that has 21 fields, it
actually crash'es... The statement that crashes is:

m_pRowset->GetData(m_hRows[0], m_hAccessor, m_pRowBuffer);

The debug log is:
Data Abort: Thread=927f9888 Proc=90841f30 'wm5test.exe'
AKY=00020001 PC=0084b250(sqlceoledb30.dll+0x0002b250) RA=0084b1f0
(sqlceoledb30.dll+0x0002b1f0) BVA=241608a5 FSR=00000003

Does anyone know what this might be?

If I open the table in MS Query Analyzer, it opens without problem,
displaying the data correctly...


This is the CREATE statement for the table that works:
CREATE TABLE tblPocketSetup (SetupKey nvarchar(50) CONSTRAINT pkSetupKey
PRIMARY KEY,SetupValue ntext);

This is the CREATE statement for the table that crashes:
CREATE TABLE tblPocketCustomer (CustomerID int CONSTRAINT pkCustomerID
PRIMARY KEY,CustomerIDText nvarchar(50) default NULL,OrganizationNumber
nvarchar(30) DEFAULT NULL,CompanyLastname nvarchar(50) default
'',ContactFirstname nvarchar(50) default NULL,Address nvarchar(30)
default NULL,Address2 nvarchar(30) default NULL,PostalNumber nvarchar
(10) default NULL,PostalPlace nvarchar(50) default NULL,Phone nvarchar
(20) default NULL,Phone2 nvarchar(20) default NULL,Mobile nvarchar(20)
default NULL,Fax nvarchar(20) default NULL,Email nvarchar(50) default
NULL,DiscountProduct float default '0',DiscountService float default
'0',Status tinyint default '0',DepartmentIDExt nvarchar(50) default
'*',ShowRecord bit default '1',RegEmployeeID int default '0',UpdateInfo
tinyint default '0');

Best regards,
Ole-Johan Ellingsen

RE:OLE DB crash... by Ole-Johan

Ole-Johan
Thu Dec 15 01:47:25 CST 2005


An update:

I have done some more testing, and the crash depends on the order of the fields in the select statement!

This one crashes:
SELECT * FROM tblPocketCustomer;

This one crashes (same order as the table, should be same as select * ):
SELECT CustomerID,CustomerIDText,OrganizationNumber,CompanyLastname,ContactFirstname,Address,Address2,PostalNumber,PostalPlace,Phone,Phone2,Mobile,Fax,Email,DiscountProduct,DiscountService,Status,DepartmentIDExt,ShowRecord,RegEmployeeID,UpdateInfo FROM tblPocketCustomer;

This one works:
SELECT CustomerID,DepartmentIDExt,CustomerIDText,OrganizationNumber,CompanyLastname,ContactFirstname,Address,Address2,PostalNumber,PostalPlace,Phone,Phone2,Mobile,Fax,Email,DiscountProduct,DiscountService,Status,ShowRecord,RegEmployeeID,UpdateInfo FROM tblPocketCustomer;

Note that what I did was to move the field DepartmentIDExt up second in the select statement. If i ommitt DepartmentIDExt, it also works.

What could this be ? I REALLY hope I don't have to debug EVERY SELECT statement and change the order of the fields to make it work...

Best regards,
Ole-Johan Ellingsen



> Hi.
>
> I am using VS2005 to create an app for WM5. I use OLE DB to access a SQL
> Mobile 3 database.
>
> I am really a beginner when it comes to OLE DB (having worked a lot with
> ADO before), but I have managed to run SQL statements successfully, and
> are now trying to read data. I create a rowset based on a SELECT
> statement. In one case I select from a simple table with two fields, and
> that works great. But if I select from a table that has 21 fields, it
> actually crash'es... The statement that crashes is:
>
> m_pRowset->GetData(m_hRows[0], m_hAccessor, m_pRowBuffer);
>
> The debug log is:
> Data Abort: Thread=927f9888 Proc=90841f30 'wm5test.exe'
> AKY=00020001 PC=0084b250(sqlceoledb30.dll+0x0002b250) RA=0084b1f0
> (sqlceoledb30.dll+0x0002b1f0) BVA=241608a5 FSR=00000003
>
> Does anyone know what this might be?
>
> If I open the table in MS Query Analyzer, it opens without problem,
> displaying the data correctly...
>
>
> This is the CREATE statement for the table that works:
> CREATE TABLE tblPocketSetup (SetupKey nvarchar(50) CONSTRAINT pkSetupKey
> PRIMARY KEY,SetupValue ntext);
>
> This is the CREATE statement for the table that crashes:
> CREATE TABLE tblPocketCustomer (CustomerID int CONSTRAINT pkCustomerID
> PRIMARY KEY,CustomerIDText nvarchar(50) default NULL,OrganizationNumber
> nvarchar(30) DEFAULT NULL,CompanyLastname nvarchar(50) default
> '',ContactFirstname nvarchar(50) default NULL,Address nvarchar(30)
> default NULL,Address2 nvarchar(30) default NULL,PostalNumber nvarchar
> (10) default NULL,PostalPlace nvarchar(50) default NULL,Phone nvarchar
> (20) default NULL,Phone2 nvarchar(20) default NULL,Mobile nvarchar(20)
> default NULL,Fax nvarchar(20) default NULL,Email nvarchar(50) default
> NULL,DiscountProduct float default '0',DiscountService float default
> '0',Status tinyint default '0',DepartmentIDExt nvarchar(50) default
> '*',ShowRecord bit default '1',RegEmployeeID int default '0',UpdateInfo
> tinyint default '0');
>
> Best regards,
> Ole-Johan Ellingsen

Re: RE:OLE DB crash... by droll

droll
Thu Dec 15 03:32:45 CST 2005

i'm no OLEDB expert on ppc either but could this be a memory leak somewhere
in your application?

i had to debug a pretty nasty one recently and it was causing all sorts of
strange behaviour at the wrong places. the code that wasn't the culprit was
crashing. the problematic code excuted properly. when i commented out the
problematic code, the code that used to crash then worked fine!

memory leaks can be very interesting :)

why not try some simple tests like select * on an empty table? or select *
on a table with 1 record and the 1 record has very small data in each of its
fields (e.g. put a single char in a nvcarchar(50) field)?