Re: IRowsetChange::SetData()
- From: "Marius Prisecaru" <prisasm@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 24 Apr 2007 08:28:34 -0400
Hi Alex,
"Alex Evans" <AlexEvans@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:66DEABEA-B7E0-4F49-B18B-7A6307DD061A@xxxxxxxxxxxxxxxx
Hi Marius,
Thanks again for your feedback. I have read Joao's article on CP, and had
several email exchanges with him. He said sometime ago that he is working
on
converting his project to be used with VS 2005, but I never heard anything
back from him.
There isn't too much to modify in order to make it work w/ VS2005. I was
able to get stuff up and running in less than a day. In fact, for 2005 there
are even less modifications required than stated in the articles posted on
CP because some things that were missing in ATL 3/4 are present in ATL 8.
So,
I will gladly switch to ATL OLE DB, if I knew how
Following Joao's suggestions in these articles, it seemed I have to make
lots of changes to MS headers etc. which I don't like the idea much - what
happens when we get another MS update?
Since the modifications are fairly minior, I wouldn't be worried about an MS
update. I think it is safe to assume that ATL will be kept around for a
while.
So, if you can offer me any help - I will really appreciate it
Have you tried the suggestion I had regarding retrieving the image data to
an ISequentialStream object and then calling ISequentialStream::Release
before attempting to call ReleaseRows?
Thanks in advance
No problem.
Alex
P.S - Are you Romanian? Where in the world are you located? I am in
Australia
Yes, I am Romanian :) Sometimes I'm in Bucharest, RO sometimes in
Cincinnati, US. :) At the moment, I'm in the US.
Marius
"Marius Prisecaru" wrote:
Hi Alex,
I recommend reading the articles by João Paulo Figueira on ATL OLEDB
Consumer Templates. I have read those when I first started working w/ SQL
Server CE/Mobile and ATL w/ OLEDB. At this point, I am using eVC 4.0 w/
SQL
Server CE 2.0 and VS2005 w/ SQL Server Mobile and I am able to use
SetData/GetData for BLOB or NON-BLOB columns successfully. I would say
that
if you follow those carefully your life would be much easier in
implementing
native solutions based on OLEDB. I had to do a few modifications to get
stuff to work but I would be happy to help you if you encounter any
problems
switching from straight OLEDB to ATL. Trust me, your life would be much
easier using the ATL OLEDB Consumer Templates.
As to your error, it seems that something is still allocated while you
are
trying to release the rows. Since this only happens when you have an
"IMAGE"
type column, I would assume that the buffer for this is still allocated
but
never released (?) - just a speculation. Have you tried to somehow obtain
that image object in your loop (in a storage object - ISequentialStream)
and
then try to release it before calling ReleaseRows? When you do a
"GetData"
it is your responsability to release the ISequentialStream (image)
object;
when you do SetData, you allocate the buffer and provide its data, but
you
don't have to release it since it will be released for you.
Marius
"Alex Evans" <AlexEvans@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BA747440-E04E-4615-80A4-37C78C3B27B8@xxxxxxxxxxxxxxxx
Hello again,
I my previous answer, I forgot to say that the error I get is
-2147418113 {E_UNEXPECTED} HRESULT
I wish I could find a working sample of using ATL, without any UI.. jus
tthe
plain basic GetData /SetData, Seek, MoveNext etc...
I am working with VS 2005 (It was all easy with ADO in the days I used
eVC3,
but ADO is no longer available under VS 2005) and using Windows Mobile
5
on
the device
Articles about using Tempolates all seem to relate to eVC3 / 4 ...
Any suggestions?
Cheers
Alex
"Marius Prisecaru" wrote:
OK, looking over your post I think I can pretty much rule out any use
of
Templates... it looks like you are using pure OLEDB. Therefore, if
that
is
the case, you can ignore the FreeRecordMemory comment. However, it is
still
important to find out the error code you get back from ReleaseRows or
if
you
haven't already done so, look over this document:
http://msdn2.microsoft.com/en-us/library/ms719771.aspx
Marius
"Marius Prisecaru" <prisasm@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
wrote
in message news:%23cCHsj1gHHA.4320@xxxxxxxxxxxxxxxxxxxxxxx
Hi,
At the end of this function the following call fails, and I need
some
help
to understand why?
// Release the rowset.
hr = pIRowset->ReleaseRows(1, prghRows, NULL, NULL, NULL);
if(FAILED(hr))
goto Exit;
This call is mandatory for a GetData in a loop, so it can't be
ignored.
Have you tried freeing the columns before attempting to Release the
rows?
I don't know if you use OLEDB w/ Templates or not, and I don't have
the
example in front of me so this is really a long shot but check out
"FreeRecordMemory" and see if that could be of any help to you. What
error
code do you get from ReleaseRows?
Here is some code from ATL for "MoveNext"; I assume you want to use
same
type of code in your loop:
/../
m_pAccessor->FreeRecordMemory(m_spRowset);
ReleaseRows(); // My comment here: implemented as /../
m_spRowset->ReleaseRows(1, &m_hRow, NULL, NULL, NULL); /../
/../
Marius
.
- Follow-Ups:
- Re: IRowsetChange::SetData()
- From: Alex Evans
- Re: IRowsetChange::SetData()
- References:
- Re: IRowsetChange::SetData()
- From: Marius Prisecaru
- Re: IRowsetChange::SetData()
- From: Alex Evans
- Re: IRowsetChange::SetData()
- From: Marius Prisecaru
- Re: IRowsetChange::SetData()
- From: Marius Prisecaru
- Re: IRowsetChange::SetData()
- From: Alex Evans
- Re: IRowsetChange::SetData()
- From: Marius Prisecaru
- Re: IRowsetChange::SetData()
- From: Alex Evans
- Re: IRowsetChange::SetData()
- Prev by Date: SQL Server CE encountered problems in creating the SQL Sever CE database
- Next by Date: Re: IRowsetChange::SetData()
- Previous by thread: Re: IRowsetChange::SetData()
- Next by thread: Re: IRowsetChange::SetData()
- Index(es):
Relevant Pages
|
Loading