Re: SampProv sample and OpenRowset
- From: "Tom Wilson" <TomBob@xxxxxxxxxxxxxxxx>
- Date: Fri, 31 Mar 2006 09:08:03 -0800
It's at least registered partly. Created the a.udl, SampProv is in the list
(as Microsoft OLE DB Sample Provider). It's hitting my DLL, because I put a
::MessageBox(... MB_OK) in the DLL_PROCESS_ATTACH of DllMain. The property
page is there for the provider - allows me to put in a directory, and it's
persisted because it's there when I come back next time. So that much of
the DLL is working correctly.
Since the last post, I've also been able to successfully trace in
VisusalStudio (after I put in the MessageBox, now I can attach to the
DllHost process and all my breakpoints fire, etc.) So when I run the line
from Query Analyzer
select * from openrowset('SampProv', 'Data Source=d:\temp',
'customer.csv')
I see the message box, I attach to the dllhost process, and I can see
various calls being made - DllMain attach process, attach thread, query for
DBSource interface (and constructor running OK), and a call to
GetProperties. But it doesn't hit any breakpoints that I have on
SetProperties, even though the error message in QueryAnalyzer suggests that
it is IDBProperties::SetProperties that is returning an error. It makes me
wonder if it isn't really even getting to the SetProperties call, but just
getting some COM error before it gets there (yes, this sounds fuzzy, just
brainstorming) or if the error message is misleading.
Finally, any ideas on what the correct format for the second argument in the
call SHOULD be - does the 'Data Source=d:\temp' look correct (even though,
as noted, I don't even see it getting to SetProperties....)
Just to keep everything in one place, the error message in Query Analyzer is
Server: Msg 7373, Level 16, State 2, Line 1
Could not set the initialization properties for the OLE DB provider
'SampProv'.
OLE DB error trace [OLE/DB Provider 'SampProv' IDBProperties::SetProperties
returned 0x80040e21].
"Kevin Yu [MSFT]" <v-kevy@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:Blqpco7UGHA.880@xxxxxxxxxxxxxxxxxxxxxxxx
Hi Tom,
Based on the error message, I think the SampProv provider was not
registered properly. You can try to create a .udl file to see if you can
connect to any data source using the SampProv. Here are the steps:
1. Create a .txt on the desktop and rename it to a.udl
2. Double click the icon and the Data Link Properties dialog will be
shown.
3. Check if the SampProv is in the provider list.
Also, if you're running this in the Query Analyzer, please also check in
the registry to see if you can find SamProv is under that key.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL
Server\90\Tools\Shell\DataProviders\
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
.
- References:
- SampProv sample and OpenRowset
- From: Tom Wilson
- RE: SampProv sample and OpenRowset
- From: Kevin Yu [MSFT]
- SampProv sample and OpenRowset
- Prev by Date: OleDb fails where ODBC succeeds!!!
- Previous by thread: RE: SampProv sample and OpenRowset
- Next by thread: OraOLEDB error '80040e4b' : Accessor is not a parameter accessor
- Index(es):
Relevant Pages
|