[Oledb-dev] PgOleDB Failed without errorcode -> result 0x80040155
fiedlerch at aol.com
fiedlerch at aol.com
Mon Feb 26 14:48:08 UTC 2007
Hi,
I am working on a project in c++ where I would like to connect to a postgresql database via the pgoledb driver.
I connect like this:
<<<<<
OleDbConnection* conn = new OleDbConnection(
"PROVIDER=PostgreSQL OLE DB Provider; Data Source=Localhost;Location=Blub;User ID=postgres2;Password=blablub");
conn->Open();
>>>>>
This does work and I am able to write to or create a table:
<<<<<
OleDbCommand* cmd = new OleDbCommand(sqlstr,conn);
cmd->ExecuteNonQuery();
>>>>>
But when I try to fire a query on the db like this:
<<<<<
String* sqlstr = String::Format("select age from main where Name = '{0}'",nam);
OleDbCommand* cmd = new OleDbCommand(sqlstr,conn);
OleDbDataReader* rdr = cmd->ExecuteReader();
>>>>>
I get an unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll
PostgreSQL OLE DB Provider fails without Errormessage, Result: -2147221163(0x80040155)
I am using Visual Studio 2005, PostgreSQL 8.2.3 and PgOleDb 1.0.0.20, WinXP SP2.
I would be thankfull for any help on this problem.
Note:
I read about the error in earlier VisualStudio releases, so I checked the atldb.h (where the bug seems to be fixed) and tried to compile the driver on my own, but this does fail because PgAtlTrace is not found in various .h files.
LogFile of the driver:
Starting logging
IDBPropertiesImpl::GetPropertyInfo
m_pCUtlPropInfo == NULL
IDBPropertiesImpl::GetProperties
IDBPropertiesImpl::SetProperties
IDBInitializeImpl::Initialize
IDBCreateSessionImpl::CreateSession
IDBPropertiesImpl::GetProperties
CErrorLookupService::ClearErrorCPgSession::PQexec 0, "SET client_encoding TO "Unicode""
CPgSession::PQexec 0, "select oid from pg_type where typname='utinyint'"
CPgSession::PQexec 0, "select oid from pg_type where typname='varcharci'"
CPgSession::PQexec 0, "SELECT oid, typalign FROM pg_type"
IDBCreateCommandImpl::CreateCommand
IObjectWithSiteImpl::SetSite
ICommandPropertiesImpl::SetProperties
CPgCommand::SetCommandText "select age from main where Name = 'Tom'"
ICommandTextImpl::SetCommandText
CPgCommand::SetParameterInfo
CErrorLookupService::ClearErrorIDBPropertiesImpl::GetProperties
ICommandPropertiesImpl::GetProperties
CPgCommand::Execute
CErrorLookupService::ClearErrorCPgCommand::FillParams
CErrorLookupService::ClearErrorICommandTextImpl::GetCommandText
IObjectWithSiteImpl::GetSite
CErrorLookupService::ClearErrorCPgSession::PQexec 0, "START TRANSACTION ISOLATION LEVEL READ COMMITTED"
CPgSession::PQexec 0, "select age from main where Name = 'Tom'"
IObjectWithSiteImpl::SetSite
CPgCommand::CreateRowset
CPgRowset::Execute
ICommandImpl::GetDBSession
CPgVirtualArray::PostConstruct
CPgVirtualArray::AttachSess
CPgRowset::PostConstruct got status "PGRES_TUPLES_OK" from command
CATLCOLUMNINFO( const ATLCOLUMNINFO &rhs ) 0x03EDF290
CATLCOLUMNINFO copy 0x03EDF27C->0x042B6690
CATLCOLUMNINFO( const CATLCOLUMNINFO &rhs ) 0x042B66B8
CATLCOLUMNINFO copy 0x042B6690->0x042B6710
CATLCOLUMNINFO delete 0x03EDF290 pwszName=0x042B6690
CPgSession::ErroredCommit
CPgSession::PQexec 0, "COMMIT"
CPgRowset::~CPgRowset
IObjectWithSiteImpl::GetSite
CATLCOLUMNINFO delete 0x042B66B8 pwszName=0x042B6710
CPgVirtualArray::~CPgVirtualArray
IDBPropertiesImpl::GetProperties
________________________________________________________________________
Kostenlos: AOL eMail
2 GB Speicherplatz sowie erstklassiger Spam- und eMail Virenschutz.
Sichern Sie sich Ihre persönliche eMail Adresse noch heute!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://pgfoundry.org/pipermail/oledb-devel/attachments/20070226/6a7f595a/attachment.html
More information about the Oledb-devel
mailing list