SQLOLEDB subset using OLE DB Provider template

SQLOLEDB subset using OLE DB Provider template

Post by Leo Dharmawa » Tue, 15 Aug 2000 04:00:00



Hi,

I am trying to create an OLE DB Provider similar to SQLOLEDB (only
exposes the subset of interfaces in SQLOLEDB), but enhanced w/ caching
mechanism.  The reason that I am doing this is because I am trying to
connect through SQL Server as linked server and thus I need to work on
the provider level (instead of using ADO).

I basically need a read-only SQL Server provider which support commands
and returning simple recordsets.  I will implement the caching mechanism
on the command interface (comparing a command against previously
submitted command and results persistence) before querying against SQL
Server.

Could I do this using OLE DB Provider template?  If I could, what would
be the best approach to this?  Should I do it through aggregation or by
implementing an OLE DB Provider that is also a consumer (consumes data
from the underlying SQLOLEDB).  If using the second approach is
possible,  would I need to implement DataSource and Session object
interfaces using DB library on C?  I'm not sure about the relationships
betwwen the DataSource-Session-Rowset hierarchy.

Thanks in advance

Leo Dharmawan

 
 
 

1. OpenQuery using OLE DB provider 'SQLOLEDB'

Hi,

I'm trying to populate data in one SQL Server db (TARGET)
using data from another SQL Server (SOURCE).  In the
TARGET server I set up SOURCE server as a linked server, I
have DTC service running.

Here is the code I'm trying to execute (it worked once,
then does work the rest of the time, I'm sure there is no
syntax error):

-- specify database name in TARGET db
Use Guardian

-- declare and set value for variables








-- begin populating reference tables
BEGIN TRANSACTION
print 'working with ApplicationClass table'
-- insert new reference data from BOI1160
INSERT INTO dbo.ApplicationClass
(ApplicationClassID, ApplicationClassName,
ApplicationClassDescription, ActiveFlag)
SELECT ApplicationClassID, ApplicationClassName,

FROM OPENQUERY(BOI1160, 'select * from
Guardian.dbo.ApplicationClass')
-- commit transaction
COMMIT

Here is the error I kept getting:
Server: Msg 7391, Level 16, State 1, Line 33
The operation could not be performed because the OLE DB
provider 'SQLOLEDB' was unable to begin a distributed
transaction.
[OLE/DB provider returned message: New transaction cannot
enlist in the specified transaction coordinator. ]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB'
ITransactionJoin::JoinTransaction returned 0x8004d00a].

I tried shutting down the DTC service, TARGET server,
deleting then adding the linked server, etc, with no
luck.  This worked once yesterday, then refused to work
afterwards.

Please help....

2. Microsoft Access 2.0 - Hints / tips / help

3. SQLOLEDB provider from OLE-DB app

4. Backup schemes

5. OLE DB Provider Template?

6. sp_sqlagent_get_perf_counters ????!!!!

7. OLE DB Provider Template

8. ODBC Drivers error '80004005'

9. insert tables in ATL OLE DB Provider Templates

10. Making ATL OLE DB Provider templates support updating of data - CCE

11. Fail POST record using Provider OLE DB for Visual Foxpro

12. MYSQL connectivity using OLE DB provider

13. Trouble using ado fields with ole db provider for internet publishing