Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f2U1juK36748 for ; Thu, 29 Mar 2001 20:45:56 -0500 (EST) (envelope-from pgsql-interfaces-owner@postgresql.org) Received: from hotmail.com (f181.law8.hotmail.com [216.33.241.181]) by mail.postgresql.org (8.11.3/8.11.1) with ESMTP id f2RGchw30800 for ; Tue, 27 Mar 2001 11:38:44 -0500 (EST) (envelope-from abstergio@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 27 Mar 2001 08:38:39 -0800 Received: from 206.47.99.133 by lw8fd.law8.hotmail.msn.com with HTTP; Tue, 27 Mar 2001 16:38:38 GMT X-Originating-IP: [206.47.99.133] From: "Apostolos B. STERGIOPOULOS" To: pgsql-interfaces@postgresql.org Subject: Re: need help with errors in ODBC log Date: Tue, 27 Mar 2001 16:38:38 -0000 Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_3f18_22ec_5008" Message-ID: X-OriginalArrivalTime: 27 Mar 2001 16:38:39.0315 (UTC) FILETIME=[606C6230:01C0B6DC] X-Archive-Number: 200103/207 X-Sequence-Number: 1369 This is a multi-part message in MIME format. ------=_NextPart_000_3f18_22ec_5008 Content-Type: text/html

Re: need help with errors in ODBC log


> Dave Page wrote:
> >
> > > -----Original Message-----
> > > From: Carolyn Lu Wong [mailto:carolyn@greatpacific.com.au]
> > > Sent: 07 November 2000 04:03
> > > To: pgsql-interfaces@postgresql.org
> > > Subject: [INTERFACES] need help with errors in ODBC log
> > >
> > >
> > > This problem is regarding VB5 application connection to postgreSQL
> > > V6.5 via PsqlODBC V6.5. I'm not sure if the problem is related to ODBC
> > > or the database. Please let me know if I should direct the question to
> > > another discussion group.
> > >
> > > When I try to open a record set from VB with a simple select
> > > statement, results are retrieved if I connect to database on a local
> > > server. However, if I try to retrieve data from remote server (via
> > > internet) with the same code, I get the following error: '3669:
> > > Execution Cancelled' (source - DAO.Connection).
> > >
> > > The statement I try to open the record set with is 'select * from
> > > accounts where account_no = 3;' I have included extractions from the
> > > ODBC log files for both cases. The only difference I can see is in the
> > > case where error arises, it has additional 'select * from select *
> > > from....' in the log. I don't know where the 'select *' that comes
> > > before the select statement comes from.
> > >
> >
> > The additional 'SELECT * FROM' is probably caused by having the command type
> > set to table rather than text in the data control. This causes the control
> > to assume that the recordsource is a tablename so it sticks SELECT * FROM in
> > front of it to create a complete query.
> >
> > HTH,
> > Regards, Dave.
> The thing is, when I run the same application accessing database from
> the local server (LAN), I don't have the VB 3669 error, and the
> additional 'Select * from' does not exist in the log file. However, if
> i'm accessing database from remote server (WAN), it causes the VB
> error and there's additional 'select * from' in the log file! Apart
> from the differences in the data, both database table definitions are
> identical.

> FYI, the source of the recordset in VB is SQL statement.


The following two lines represent a code fragment that can be used with the VB development; we can place these lines within our 'Main' routine(s) and 'massage' their values to iron-out many access problems, not excluding the infamous 'Database Cancellation' run-time error 3669:

glLoginTimeout = Val(GetINIString("LoginTimeout", "20"))

glQueryTimeout = Val(GetINIString("QueryTimeout", "60"))

BTW, the values presented above, are the default values for these properties. I attach a couple of extracts from the VB on-line help, to shed more light into this issue.

Enjoy,

-Toli       :-)

____________________________________________________________ 

         I Only Know One Thing -- That I Know Nothing! (SOCRATES)
____________________________________________________________



Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

------=_NextPart_000_3f18_22ec_5008 Content-Type: text/plain; name="TimeOutProperites.txt"; format=flowed Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="TimeOutProperites.txt" ======================= LoginTimeout Property ======================= Sets or returns the number of seconds before an error occurs when you attempt to log on to an ODBC database. Settings and Return Values ~~~~~~~~~~~~~~~~~~~~~~~~~~ The setting or return value is an Integer representing the number of seconds before a login timeout error occurs. The default LoginTimeout property setting is 20 seconds. When the LoginTimeout property is set to 0, no timeout occurs. Remarks ~~~~~~~ When you're attempting to log on to an ODBC database, such as Microsoft SQL Server, the connection can fail as a result of network errors or because the server isn't running. Rather than waiting for the default 20 seconds to connect, you can specify how long to wait before raising an error. Logging on to the server happens implicitly as part of a number of different events, such as running a query on an external server database. You can use LoginTimeout on the DBEngine object in both Microsoft Jet and ODBCDirect workspaces. You can use LoginTimeout on the Workspace object only in ODBCDirect workspaces. Setting the property to -1 on a Workspace will default to the current setting of DBEngine.LoginTimeout. You can change this property in a Workspace at any time, and the new setting will take effect with the next Connection or Database object opened. The default value is determined by the ODBC driver. In a Microsoft Jet workspace, you can override the driver’s default value by creating a new “ODBC” key in the Registry path \HKEY_LOCAL_MACHINE\SOFTWARE\Jet\3.5\, creating a LoginTimeout parameter in this key, and setting the value as desired. ======================= QueryTimeout Property ======================= Sets or returns a value that specifies the number of seconds to wait before a timeout error occurs when a query is executed on an ODBC data source. Settings and Return Values ~~~~~~~~~~~~~~~~~~~~~~~~~~ The setting or return value is an Integer representing the number of seconds to wait. The default value is 60. Remarks ~~~~~~~ When you're using an ODBC database, such as Microsoft SQL Server, there may be delays due to network traffic or heavy use of the ODBC server. Rather than waiting indefinitely, you can specify how long to wait. When you use QueryTimeout with a Connection or Database object, it specifies a global value for all queries associated with the database. You can override this value for a specific query by setting the ODBCTimeout property of the particular QueryDef object. In a Microsoft Jet workspace, you can override the default value by creating a new “ODBC” key in the Registry path \HKEY_LOCAL_MACHINE\SOFTWARE\Jet\3.5\, creating a QueryTimeout parameter in this key, and setting the value as desired. ------=_NextPart_000_3f18_22ec_5008--