X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 205A3DAEE4; Wed, 26 Oct 2005 10:10:16 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 90459-05; Wed, 26 Oct 2005 13:10:11 +0000 (GMT) Received: from ls405.htnet.hr (ls405.htnet.hr [195.29.150.97]) by svr1.postgresql.org (Postfix) with ESMTP id 4D865DACBE; Wed, 26 Oct 2005 10:10:12 -0300 (ADT) Received: from ls422.t-com.hr (ls422.t-com.hr [195.29.150.237]) by ls405.htnet.hr (0.0.0/8.12.10) with ESMTP id j9QDAFWj008311; Wed, 26 Oct 2005 15:10:15 +0200 Received: from ls422.t-com.hr (localhost.localdomain [127.0.0.1]) by ls422.t-com.hr (Qmlai) with ESMTP id 74083988047; Wed, 26 Oct 2005 15:10:15 +0200 (CEST) X-Envelope-Sender: zlatko.matic1@sb.t-com.hr X-Envelope-Sender: zlatko.matic1@sb.t-com.hr X-Envelope-Sender: zlatko.matic1@sb.t-com.hr X-Envelope-Sender: zlatko.matic1@sb.t-com.hr Received: from ls422.t-com.hr (localhost.localdomain [127.0.0.1]) by ls422.t-com.hr (Qmlai) with ESMTP id 5140D988045; Wed, 26 Oct 2005 15:10:15 +0200 (CEST) Received: from zlatkovyfkpgz6 (83-131-240-52.adsl.net.t-com.hr [83.131.240.52]) by ls422.t-com.hr (Qmlai) with SMTP id C05748B807A; Wed, 26 Oct 2005 15:10:12 +0200 (CEST) Message-ID: <000001c5da2e$9a167140$0123fea9@zlatkovyfkpgz6> From: =?iso-8859-2?Q?Zlatko_Mati=E6?= To: , , , References: <6EE64EF3AB31D5448D0007DD34EEB3417DD63B@Herge.rcsinc.local> <000001c5d621$74a36fa0$52bffea9@zlatkovyfkpgz6> <4359054C.2040307@us.michelin.com> Subject: Re: [ODBC] versions of oDBC driver Date: Wed, 26 Oct 2005 14:48:57 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-2"; reply-type=original X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.168 required=5 tests=[AWL=-0.798, WEIRD_QUOTING=1.966] X-Spam-Level: * X-Archive-Number: 200510/1609 X-Sequence-Number: 85838 Hello. After I tried different things, I finally figured out where is the proble= m=20 with connection string: "Driver=3D{PostgreSQL}" must be changed to=20 "Driver=3D{PostgreSQL Unicode}". Now it works. But this new connection string works only with Postgres 8.1, while it=20 doesn't work with Postgres 8.0... I must say that current documentation lacks with information about=20 connection string parameters. Everything I could find about it was quite = old=20 and not sufficient. It would be really nice if someone competent would wr= ite=20 some document regarding ODBC connection string parameters to explain thei= r=20 meaning for "dummies" like me. I suppose I'm not the only one trying to u= se=20 MS Access with PostgreSQL. I think it is quite good combination for=20 hobbiests and people who are not programmers but want to create some=20 specific solutions for their job. MS Access is very easy to use and learn= =20 and is widespread also, so supporting people in such efforts would=20 definitely increase popularity of PostgreSQL. Understanding ODBC connecti= on=20 string parameters is essential for that. Regarding connection parameters, for example, I would kindly ask you to t= ell=20 me which parameters are not neccessary in my connection string, so that I= =20 can remove it, in order to allow more space in connection string. You hav= e=20 already mentioned: "Secondarily, I find that not every parameter is=20 essential for the connection string. You might trying dropping your=20 strConnParams, and if that helps, debugging them one at a time, or by=20 halves.", so I would like to optimize my connection string to allow more=20 space for really important parameters in limited connection string in=20 Access... This is my connection string: strConnInfo =3D "ODBC;Driver=3D{PostgreSQL Unicode};Server=3D" & SERVER &= ";Port=3D"=20 & PORT & ";Database=3D" & DATABASE & ";" strConnUserPass =3D "Uid=3D" & USERNAME & ";Pwd=3D" & PASSWORD & ";" strConnParms =3D "A0=3D0;A1=3D6.4;A2=3D0;A3=3D0;A4=3D1;A5=3D0;A6=3D" & A= 6 & ";A7=3D100;A8=3D" &=20 SOCKET & ";A9=3D1;" & _ "B0=3D254;B1=3D8190;B2=3D0;B3=3D0;B4=3D1;B5=3D1;B6=3D0;B7=3D1;B8=3D0;B9=3D= 0;" & _ "C0=3D0;C1=3D0;C2=3Ddd_;" strConnection =3D strConnInfo & strConnUserPass & strConnParms What can I remove from it? Thanks, Zlatko ----- Original Message -----=20 From: "Greg Campbell" To: "Zlatko Mati=E6" Cc: ; Sent: Friday, October 21, 2005 5:12 PM Subject: Re: [ODBC] versions of oDBC driver Did you changed the Postgresql server and the client ODBC driver at the s= ame=20 time? My guess is that the pg_hba is not configured to let you in,... I would make sure the PostgreSQL server is set to having connection loggi= ng=20 enabled, and see what type of errors it is throwing on the server. Secondarily, I find that not every parameter is essential for the connect= ion=20 string. You might trying dropping your strConnParams, and if that helps, debugging them one at a=20 time, or by halves. Zlatko Mati=E6 wrote: > Hello. > The error is error 3151: "ODBC--connection to '{PostgreSQL}Localhost'=20 > failed". > I have a form with text boxes for entering Database name, IP adress,=20 > username, password etc. When a user push the confirmation button, a=20 > function "ConnectionToServer" is executed to: a) create connection stri= ng,=20 > b) to check whether connection string works, c) to call functions for=20 > relinking linked tables and adjusting connection string in pass-through= =20 > queries. The code is following: > > Option Compare Database > Public strConnection As String > > Function ConnectionToServer(SERVER As String, PORT As String, SOCKET As= =20 > String, DATABASE As String, USERNAME As String, PASSWORD As String,=20 > ENCODING As String) As Boolean > > Dim db As Object > Dim qdf As Object > Dim qdfSQL As String > Dim rs As Object > > Dim strConnInfo As String > Dim strConnUserPass As String > Dim strConnParms As String > Dim CurrentUser As String > Dim A6 As String > > On Error GoTo ErrorHandler > > DoCmd.Hourglass True > > Set db =3D CurrentDb > > ' PG_ODBC_PARAMETER ACCESS_PARAMETER > ' ********************************************* > ' READONLY A0 > ' PROTOCOL A1 > ' FAKEOIDINDEX A2 'A2 must be 0 unless A3=3D1 > ' SHOWOIDCOLUMN A3 > ' ROWVERSIONING A4 > ' SHOWSYSTEMTABLES A5 > ' CONNSETTINGS A6 > ' FETCH A7 > ' SOCKET A8 > ' UNKNOWNSIZES A9 ' range [0-2] > ' MAXVARCHARSIZE B0 > ' MAXLONGVARCHARSIZE B1 > ' DEBUG B2 > ' COMMLOG B3 > ' OPTIMIZER B4 ' note that 1 =3D _cancel_ generic=20 > optimizer... > ' KSQO B5 > ' USEDECLAREFETCH B6 > ' TEXTASLONGVARCHAR B7 > ' UNKNOWNSASLONGVARCHAR B8 > ' BOOLSASCHAR B9 > ' PARSE C0 > ' CANCELASFREESTMT C1 > ' EXTRASYSTABLEPREFIXES C2 > > Select Case ENCODING > Case "DEFAULT" > A6 =3D "" > Case "UNICODE" > A6 =3D "CLIENT_ENCODING=3DUNICODE" > Case "SQL_ASCII" > A6 =3D "CLIENT_ENCODING=3DSQL_ASCII" > Case "WIN1250" > A6 =3D "CLIENT_ENCODING=3DWIN1250" > Case "UTF8" > A6 =3D "CLIENT_ENCODING=3DUTF8" > Case Else > A6 =3D "" > End Select > > ' Connection String > strConnInfo =3D "ODBC;Driver=3D{PostgreSQL};Server=3D" & SERVER & ";Po= rt=3D" &=20 > PORT & ";Database=3D" & DATABASE & ";" > strConnUserPass =3D "Uid=3D" & USERNAME & ";Pwd=3D" & PASSWORD & ";" > strConnParms =3D "A0=3D0;A1=3D6.4;A2=3D0;A3=3D0;A4=3D1;A5=3D0;A6=3D" &= A6 & ";A7=3D100;A8=3D"=20 > & SOCKET & ";A9=3D1;" & _ > "B0=3D254;B1=3D8190;B2=3D0;B3=3D0;B4=3D1;B5=3D1;B6=3D0;B7=3D1;B8=3D0;B9= =3D0;" & _ > "C0=3D0;C1=3D0;C2=3Ddd_;" > > strConnection =3D strConnInfo & strConnUserPass & strConnParms > > 'Checking connection > Set qdf =3D db.CreateQueryDef("") > qdf.connect =3D strConnection > strSQL =3D "SELECT CURRENT_USER AS ""CURRENTUSER""" > qdf.SQL =3D strSQL > qdf.returnsrecords =3D True > Set rs =3D qdf.openrecordset() > > CurrentUser =3D rs.Fields("CURRENTUSER") > > DoCmd.Hourglass False > > If CurrentUser =3D USERNAME Then > MsgBox "You have successfully connected as: " & USERNAME, ,=20 > "Connection to the server" > ConnectionToServer =3D True > Else > MsgBox "Connection to server failed. Check connection parameters an= d=20 > try again." > ConnectionToServer =3D False > GoTo ErrorHandler > End If > > > DoCmd.Hourglass True > > 'Calling functions for relinking of linked tables and adjusting connect= ion=20 > string of pass-through queries. > Call RelinkLinkedTables(SERVER, DATABASE) > Call RelinkPassThroughQueries > > GoAway: > > DoCmd.Hourglass False > Exit Function > > ErrorHandler: > > Dim strErr As String > MsgBox "Connection to server failed. Check connection parameters an= d=20 > try again", , "Connection to Server" > > strErr =3D "VBA-Error Information" & vbNewLine > strErr =3D strErr & "Number: " & vbTab & vbTab & Err.Number & vbNew= Line > strErr =3D strErr & "Description: " & vbTab & Err.Description &=20 > vbNewLine > strErr =3D strErr & "LastDLLError: " & vbTab & Err.LastDllError &=20 > vbNewLine > strErr =3D strErr & vbNewLine > MsgBox strErr, vbOKOnly + vbExclamation, "Error" > > Resume GoAway > > End Function > > > It was working perfectly well with PostgreSQL 8.0.4 and=20 > psqlodbc-08_00_0102... > > What is wrong now ? > > Zlatko > ----- Original Message -----=20 > From: Merlin Moncure > To: Zlatko Matic > Cc: pgsql-odbc@postgresql.org > Sent: Thursday, October 20, 2005 2:06 PM > Subject: Re: [ODBC] versions of oDBC driver > > > why not? What kind of error are you getting? The latest revisions of= =20 > the driver are probably best unless you are using declare/fetch (see=20 > archives). > > > > Merlin > > > > > -----------------------------------------------------------------------= ------- > > From: pgsql-odbc-owner@postgresql.org=20 > [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of "Zlatko Matic" > Sent: Thursday, October 20, 2005 6:34 AM > To: pgsql-odbc@postgresql.org; pgsql-interfaces@postgresql.org;=20 > pgsql-general@postgresql.org > Subject: [ODBC] versions of oDBC driver > > > > Hello. > > > > Could someone say which versions of ODBC drivers are recommended for=20 > PostgreSQL/MS Access 2003 combination, for: > > a) Postgres 8.0.4 > > b) Postgres 8.1 beta > > > > Namely, I was not able to connect from my Access front-end when I=20 > migrated from Postgres 8.0.4 to Postgres 8.1 beta3.... > > Are there any significant changes that could cause such problems in=20 > connection strings ? > > > > Zlatko > -------------------------------------------------------------------------= ------- ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly