Re: HOW TO - convert CDataSource InitializationString to IDBProperties
- From: "Bob Beauchemin" <no_bobb_spam@xxxxxxxxxxxxx>
- Date: Thu, 1 Sep 2005 08:56:33 -0700
I think you'll have to go to the native OLE DB interfaces for this one.
IDataInitialize::GetDataSource does what you want but it returns a
DataSource object with the properties set rather than use an existing one.
IDataInitialize is a method on CLSID_MSDAINITIALIZE so if CDataSource has
one of these lying around you could use it, otherwise, you need to
CoCreateInstance it yourself.
If you wanted to use the DataSource that GetDataSource returns, you could
most likely set it into the correct property of CDataSource, like atldbcli.h
does.
Hope this helps,
Bob Beauchemin
http://www.sqlskills.com/blogs/bobb
"Bob" <bob@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D80D9BE8-B806-419E-990A-BC31CB1B9222@xxxxxxxxxxxxxxxx
> I'm using the CDataSource::Open() method to allow the user to build up
> their
> connection string for various OLEDB providers. This works great and I can
> get the connection string and save off, by calling the
> GetInitializationString method.
>
> The problem I have is that I want to allow them to Edit an already built
> connection string. I am looking at copying the CDataSource code and
> modifying the Open method to pass in the previously created
> InitiailzationString, but I haven't found any sample code or methods that
> will convert the string into an IDBProperties component - so that I can
> pass
> the properties into the dialog.
>
> I am not going to store off individual properties, so I need to find a way
> to convert the string to the IDBProperties, and I'm hoping there is
> something
> built-into OLEDB to do this.
>
> Thanks in advance for any info,
>
> --
> Bob
> Sr. Microsoft Architect
> Lighthammer Software
.
- References:
- Prev by Date: HOW TO - convert CDataSource InitializationString to IDBProperties
- Next by Date: Re: Provider not found
- Previous by thread: HOW TO - convert CDataSource InitializationString to IDBProperties
- Next by thread: Re: Provider not found
- Index(es):