[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ms-atl
Subject:    SV: OLEDB consumer object
From:       Dan Lewi Harkestad <Dan.Harkestad () EPHORMA ! NO>
Date:       2000-07-29 11:40:23
[Download RAW message or body]


Well, I'm not sure it's going to solve your problem, but whenever I am
accessing the OLE DB consumer for oracle, I either use CLSID_MSDAORA (you
need to do #define DBINITCONSTANTS and then #include <msdaora.h> to use this
CLSID), or the prog id MSDAORA or MSDAORA.1, not MSDORA. Works like a charm
for me.

This is how I usually connect:
CDataSource dsDatabase;
TCHAR szTNSName[<whatever size suits you>];
TCHAR szUserID[<..>];
TCHAR szPassword[<..>];

... fill the strings with data ...

HRESULT hr = dsDatabase.Open(_T("MSDAORA"), szTNSName, szUserID,
szPassword);

... do something with the connection ...

Hope it helped! (Btw, the HRESULT you got back was E_FAIL. Not very helpful,
eh? If you need more error info, create an IErrorInfo interface pointer
(CComPtr<IErrorInfo> einfo;) and do a GetErrorInfo on it. That should give
you the latest error, something like the error object in Visual Basic).

Well, that's it! Good luck!

Cheers,
Dan Lewi

> -----Opprinnelig melding-----
> Fra: Vadiraj Hosur [mailto:hvadiraj@SATYAMONLINE.COM]
> Sendt: 28. juli 2000 12:09
> Til: ATL@DISCUSS.MICROSOFT.COM
> Emne: OLEDB consumer object
>
>
> Hi,
>    I tried to provide dynamic values for OpenDataSource
> function. But it does'nt work..... I checked the values
> before having the db.Open(_T("MSDORA.1"),&dbinit)
> values........ It fails giving ( HRESULT value -2147467259)..........
>   How do I get rid of this problem. I tried all possible
> datatypes for the userid, pwrd, alias etc...including CHAR,
> LPOLESTR, LPCTSTR etc...........
>
> Thanks in advance.........
>
> Vadiraj
>
> ----------------------------------------------------------------
> Users Guide http://msdn.microsoft.com/workshop/essentials/mail.asp
> contains important info including how to unsubscribe.  Save
> time, search
> the archives at http://discuss.microsoft.com/archives/index.html
>

----------------------------------------------------------------
Users Guide http://msdn.microsoft.com/workshop/essentials/mail.asp
contains important info including how to unsubscribe.  Save time, search
the archives at http://discuss.microsoft.com/archives/index.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic