[Oledb-dev] sample VC++ code for oledb
Konstantin Izmailov
kizmailov at gmail.com
Tue May 16 16:32:59 UTC 2006
Try to assign m_pConn->Open return code to a temp variable and see its
value:
HRESULT hr = m_pConn->Open(...);
Make sure m_pConn is not NULL.
On 5/16/06, Green Eggs And Ham <tlkj at hotmail.com> wrote:
>
> Hi,
>
> I tried the import change (that you mentioned below) and it still fails
> with:
> "An invalid handle was specified".
>
> As an aside, I have a java app that uses the same postgre database with
> the
> save password and username and it works fine. So I know the database, user
> name, password, are valid.
>
>
> >From: Victor Snezhko <snezhko at indorsoft.ru>
> >To: "Green Eggs And Ham" <tlkj at hotmail.com>
> >CC: snezhko at indorsoft.ru
> >Subject: Re: [Oledb-dev] sample VC++ code for oledb
> >Date: Tue, 16 May 2006 10:26:03 +0700
> >
> >"Green Eggs And Ham" <tlkj at hotmail.com> writes:
> >
> > > Thanks for responding !
> > >
> > > I tried your code on my database and I get a dialog pop up with this
> >error:
> > > First-cance exception at 0x7c9oeb74 in postgreTest.exe: 0xC00000008:
> > > An invalid handle was specified.
> > >
> > > I used this Open code:
> > >
> > > if (FAILED (m_pConn->Open (_bstr_t
> > > ("Provider=PostgreSQL.1;Password=postgres;User ID=postgres;Data
> > > Source=localhost;Location=mace;Extended Properties=\"\""),
> > > _bstr_t (""), _bstr_t (""), adModeUnknown)))
> > >
> > > Any ideas ?
> >
> >Yes, I forgot to mention, you need to add
> >
> >#import "msado15.dll" no_namespace rename(EOF, adoEOF)
> >
> >to your stdafx.h
> >
> >Some documentation is here:
> >
> >
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdhowhowvcusersshouldreadadodocumentation.asp
> >
>
>
> _______________________________________________
> Oledb-devel mailing list
> Oledb-devel at pgfoundry.org
> http://pgfoundry.org/mailman/listinfo/oledb-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://pgfoundry.org/pipermail/oledb-devel/attachments/20060516/8daf8807/attachment.html
More information about the Oledb-devel
mailing list