Skip site navigation (1) Skip section navigation (2)

VB.NET web applications accessing PostgresSql through ODBC

From: "Allan Sullivan" <allan(dot)sullivan(at)nortak(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: VB.NET web applications accessing PostgresSql through ODBC
Date: 2006-12-15 20:58:29
Message-ID: 3D9BF154E1B04444B6D07D04B1F0CD4F04F920@ntk-mail2k3.nortak.com (view raw or flat)
Thread:
Lists: pgsql-novice

I've just started working with PostgresSQL. Currently, we are using version 8.2 on a Windows XP platform for both the Postgres DB and all other application files.

I am trying to estabish a connection to the database using ODBC (PostgreSQL Unicode driver 8.02.02.00) within a VB.Net application. When I make the connection as a desktop application, I am able to successfully access the database. However, when I attempt to make the connection through a VB.Net web application, I am getting the following error: 

ERROR [28000] Communication error during authentication; Error while reading from the socket.

I've tried using both direct ODBC functions and ADO objects, with similar problems (i.e. it functions in a desktop environment, but not through a web environment). An example of my code to access the database is as follows:

        Dim szConnect As String = "DSN=mydsnname;UID=myuid;PWD=******"
        Dim cnDB As New Odbc.OdbcConnection(szConnect)
        cnDB.Open()    ' <--- this is where the code fails
        Dim dsDB As New DataSet
        Dim adDB As New Odbc.OdbcDataAdapter
        Dim cbDB As New Odbc.OdbcCommandBuilder(adDB)
        adDB.SelectCommand = New Odbc.OdbcCommand("Select * from mytable", cnDB)
        adDB.Fill(dsDB)

Any idea why the failure occurs when doing web applications? Is there some set of permissions I have to give to the web server process or some other code in order to give it permission to run ODBC applications?

Responses

pgsql-novice by date

Next:From: Richard Broersma JrDate: 2006-12-15 22:22:50
Subject: Re: VB.NET web applications accessing PostgresSql through ODBC
Previous:From: Richard Broersma JrDate: 2006-12-15 05:39:36
Subject: Re: Upgrade Backup Issue

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group