X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id C212FD1C4BC for ; Mon, 9 Feb 2004 19:26:01 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 83262-09 for ; Mon, 9 Feb 2004 15:25:53 -0400 (AST) Received: from gpdnet.co.uk (gpdnet.plus.com [212.56.100.243]) by svr1.postgresql.org (Postfix) with ESMTP id AE50DD1C9E1 for ; Mon, 9 Feb 2004 15:25:50 -0400 (AST) Received: from Spooler by gpdnet.co.uk (Mercury/32 v4.01a) ID MO001102; 9 Feb 2004 19:25:54 -0000 Received: from spooler by gpdnet.co.uk (Mercury/32 v4.01a); 9 Feb 2004 19:25:37 -0000 Received: from gary (192.168.1.2) by gpdnet.co.uk (Mercury/32 v4.01a) with ESMTP ID MG001101; 9 Feb 2004 19:25:27 -0000 From: "Gary Doades" To: pgsql-odbc@postgresql.org Date: Mon, 09 Feb 2004 19:25:25 -0000 MIME-Version: 1.0 Subject: Connection string problems Message-ID: <4027DEA5.5176.425EF09A@localhost> X-mailer: Pegasus Mail for Windows (v4.12a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/23 X-Sequence-Number: 3776 I seem to have a problem forming a suitable connect string for the PostgreSQL ODBC driver. I am using Windows XP and visual studio.net 2003 with C#. If I have a connection string as: string strConnect = "DSN=PostgreSQL30;UID=postgres;SERVER=192.168.1.102; Port=5432;"; And I have defined the database to connec to in the DSN then everything works fine. What I want to do however is not have to define a DSN for every database that I have or when new ones are created. Normally (with MS SQLServer etc.) I would specify the driver name and database in the connection string itself. So I use: string strConnect = "DRIVER={PostgreSQL};UID=postgres;SERVER=192.168.1.102; Port=5432; Database=webroster"; I get an exception (OdbcException) thrown in C# that has NO error information at all in it and the connection fails. I get this same problem if I specify the DSN but the DSN definition itself does not specify a database. Am I using the right keywords in the connection string? I have tried to look around for definitions of the keywords that the ODBC driver accepts, but I can only find various examples like the one I am using. If I specify a DSN in the connect string and the DSN specifies a database then the connection and all other functions work just fine. Any ODBC exceptions thrown at any other point in my code have all the correct error information in them. Any suggestions appreciated. Thanks Gary.