Re: Jet 4 - Excel ISAM - IRowsetChange



On Jun 18, 4:42 pm, rubble <bflint_goo...@xxxxxxxxxxxxxxxx> wrote:
We have some generic table creation code that does the following

1. Given a src IRowset, queries for all columns' Type Info and ...
2. Given a dest session, it QIs for ITableDef.. and creates a table
from column TypeInfo in #1, and requests an IRowsetChange ptr
3. Iterates the original IRowset and ->Inserts into the IRowsetChange
from #2

This works marvellously (it has some primitive data-type mapping too)
for 'real' OLEDB providers ... but fails dismally when trying to push
into Excel. The ITableDef->CreateTable works, and i get an
IRowsetChange ptr back, but any attempt to insert using that returns a
"Method is not supported by this provider" error (DB_E_NOTSUPPORTED)

Some questions ...

1. Anyone got this to work, at on OLEDB itf level? (I don't want
INSERT/SELECT ;)
2. Can Excel be written to this way? (all other docs point to DAO)
3. Does Excel have a 'basic, default' type it would prefer - ie
DBTYPE_WSTR ?

Any help, greatly appreciated

tia
barney

For the sake of completeness ...

i added the following properties to the rowset

DBPROP_UPDATABILITY as DBPROPVAL_UP_INSERT
DBPROP_IRowsetChange

and it works a treat

hope this helps someone else ...

.