Received: from mail.sitestar.com (root@mail.sitestar.com [38.228.4.18]) by hub.org (8.8.8/8.7.5) with ESMTP id MAA12346 for ; Thu, 6 Aug 1998 12:03:09 -0400 (EDT) Received: from loopy.sitestar.com (loopy.sitestar.com [38.228.4.19]) by mail.sitestar.com (8.8.5/8.8.6) with SMTP id MAA23001 for ; Thu, 6 Aug 1998 12:00:55 -0400 From: "William McCracken" To: Subject: Accessing PostgreSQL from windows NT with ODBC Date: Thu, 6 Aug 1998 12:03:34 -0400 Message-ID: <000f01bdc153$c3765380$1304e426@loopy.sitestar.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2232.26 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 I am accessing a postgres server running on a Linux box through the postgres odbc driver for windows95/NT. I have my DSN set up and am able to open my connection with Win32::ODBC. I can run a simple query and retrieve the field names for the query but cannot get any data out of the query. My ODBC logs say that the query returned 83 records but Win32::ODBC says that it has 0. Here's my script: use Win32::ODBC; if (!($O = new Win32::ODBC('PostgreSQL'))){ print "Failure. \n\n"; exit(); }else{ print "Success (connection #", $O->Connection(), ")\n\n"; } if (! $O->Sql("SELECT * FROM cat_structure")) { @FieldNames = $O->FieldNames(); foreach $FieldName (@FieldNames) { print "$FieldName\n"; } print "Number: ", $O->RowCount(), "\n"; while($O->FetchRow()) { print "Trying first row\n\n"; undef %Data; %Data = $O->DataHash(); print "$Data{'title'}\n"; } } $O->Close(); exit; ------------------------------ Here is what it returns: Success (connection #1) catid title sub_of Number: 0 -------------------------------- And here is the log from windows ODBC: conn=13437052, SQLDriverConnect( in)='DSN=PostgreSQL;', fDriverCompletion=0 DSN info: DSN='PostgreSQL',server='www.sitestar.com',port='5432',dbase='soccermall',us er='',passwd='' readonly='0',protocol='',showoid='0',fakeoidindex='0',showsystable='0' conn_settings='' translation_dll='',translation_option='' conn=13437052, SQLDriverConnect(out)='DSN=PostgreSQL;DATABASE=soccermall;SERVER=www.sitesta r.com;PORT=5432;UID=will;PWD=;READONLY=0;PROTOCOL=;FAKEOIDINDEX=0;SHOWOIDCOL UMN=0;ROWVERSIONING=0;SHOWSYSTEMTABLES=0;CONNSETTINGS=' Global Options: fetch=100, socket=4096, unknown_sizes=0, max_varchar_size=254, max_longvarchar_size=4094 disable_optimizer=1, unique_index=0, use_declarefetch=1 text_as_longvarchar=1, unknowns_as_longvarchar=0, bools_as_char=1 extra_systable_prefixes='dd_;', conn_settings='' conn=13437052, query=' ' conn=13437052, query='BEGIN' conn=13437052, query='set DateStyle to 'ISO'; set geqo to 'OFF'' Command response: 'SET VARIABLE' conn=13437052, query='declare SQL_CUR13451544 cursor for select oid from pg_type where typname='lo'' conn=13437052, query='fetch 100 in SQL_CUR13451544' [ fetched 0 rows ] conn=13437052, query='close SQL_CUR13451544' conn=13437052, query='END' conn=13437052, query='BEGIN' conn=13437052, query='declare SQL_CUR13451544 cursor for SELECT * FROM cat_structure' conn=13437052, query='fetch 100 in SQL_CUR13451544' [ fetched 83 rows ] conn=13437052, query='close SQL_CUR13451544' conn=13437052, query='END' conn=13437052, SQLDisconnect ---------- Any help would be greatly appreciated. Thanks, Will McCracken