Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hlfhz-0000qB-3V for pgsql-general@arkaria.postgresql.org; Thu, 11 Jul 2019 20:30:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hlfhx-0001BZ-Tg for pgsql-general@arkaria.postgresql.org; Thu, 11 Jul 2019 20:30:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hlfhx-0001BP-K8 for pgsql-general@lists.postgresql.org; Thu, 11 Jul 2019 20:30:25 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hlfhu-0006IJ-Tp for pgsql-general@lists.postgresql.org; Thu, 11 Jul 2019 20:30:25 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id B73472203E; Thu, 11 Jul 2019 16:30:21 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 11 Jul 2019 16:30:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=g amF1qmra+MmYDGjT9TtjmTbbc5m3zMUrX69cgwNkAE=; b=ptdBSwN2ISNp/9LjW WVgFVFsiOB3xyhYmRDZdvamJO4zQKJ0ALiH2EPBj/1FCVdP5qgvfUzqv3E5zqCHp l9u1JOCDDwJgbUbcvAtoqjm9vHSFnP49bbS0F/SDhdG24xLsFU/L3n2rkbfb+dwG 4UVp36TZ1iD+aCFWNbNvnzPwml+VSU38eQilC/JHjzOOBJdVhdyYKCSA2pGqn8sw PtqACkZUheG2tVCnR0hANhCzSTr8OJvLyGDxPb37a6WUL0dYTKgMMU/nDqhdMssS lZwY4Dh2HOpujDQTVthK+0CXbu2woO5y+eX7CnLVBhIqJsiMh0ZIgKwNarSPXlyC HqLYQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=gamF1qmra+MmYDGjT9TtjmTbbc5m3zMUrX69cgwNk AE=; b=0PrFrYm26q017ZC9n0BTBbzMWIfD/ikgqW+p5wNjV98Ri6kyC00XCPRMF wr2AlabWQCfYIgE+qIn87k7MSdwxz8Pvn9SyynYUhmo/y3EFCAVpWaimDPPslh0d P1h1UJ2kAhI2X7yduFZydEhIMJshBB2k1FbcvIixJxbv3fOSFvkqmkOxgxr05ZNV gMmItG1fl8lUQdiz/9zRfk0xS+Tr/x9o8+eI8UCbDfJQPc8BbRzjGVAemiiJibHk kVYZIPpnIVLacAw+D9TiFkZIwSb2u3O0mnp7cWp4UAuyDvX3Wj6dWvZT7Q6hjvBA JDZ+CrSReU5VmFfInaW04jNJ5jfHA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrgeekgdduheduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefheenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecukfhppeejuddrvddu vddrudehtddrvddtvdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklh grvhgvrhesrghklhgrvhgvrhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [192.168.1.4] (unknown [71.212.150.202]) by mail.messagingengine.com (Postfix) with ESMTPA id 9C1C280060; Thu, 11 Jul 2019 16:30:20 -0400 (EDT) Subject: Re: Postgresql and VBA - Connection Timeout To: Wayne Mell , "pgsql-general@lists.postgresql.org" References: From: Adrian Klaver Message-ID: Date: Thu, 11 Jul 2019 13:30:19 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 7/11/19 1:04 PM, Wayne Mell wrote: > Can someone help me with executing a postgres function from VBA?  No > matter what function I call, it always times out after exactly 30 > seconds.  I've tried to use the statement_timeout a million different > ways and always get an error that states "Cancelling statement due to > statement timeout" in Access. > > Here is the code I've been using to test: > > Dim cnn As ADODB.Connection > Dim cnnCmd As ADODB.Command > >  Set cnn = New ADODB.Connection >        cnn.ConnectionString = "Driver={PostgreSQL > Unicode(x64)};Server=postgres.office.server;Port=5432;Database=DBS;UID=postgresuser;PWD=postgrespwd;" >        cnn.ConnectionTimeout = 0 >        cnn.Open > > Set cnnCmd = New ADODB.Command > cnnCmd.CommandTimeout = 0 > > Set cnnCmd = cnn.Execute("select pg_sleep(50);") > > There are other functions that I've tried to execute, and they all work > as long as they take less than 30 seconds to run.  I just started > running pg_sleep to test. > > If I log into pgAdmin with the same user name and password, and on the > same machine, then the functions will execute no matter how long they > take.  It's only through VBA and the psqlODBC driver that I have the 30 > second timeout limit. > > Has anyone found a way to make this work?  Thanks. Realized you are setting CommandTimeout = 0. Maybe this thread will help?: https://www.postgresql.org/message-id/1516895461336-0.post%40n3.nabble.com Otherwise I would see if someone over on the -odbc list: https://www.postgresql.org/list/pgsql-odbc/ could help. > > -- Adrian Klaver adrian.klaver@aklaver.com