Re: PostgreSQL Connection

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Paul (pgcomputing_at_blueyonder.co.uk)
Date: 10/10/04

  • Next message: Anubis: "Help with connection.errors"
    Date: Sun, 10 Oct 2004 22:32:10 GMT
    
    

    "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
    news:uwWTfQsrEHA.3288@TK2MSFTNGP12.phx.gbl...
    > Paul wrote:
    >> Hi,
    >>
    >> I am trying to connect to a PostgreSQL database using asp. The code
    >> is as follows:
    >
    > I am not familiar with PostgreSQL, but i do have a couple comments.
    >>
    >> <%
    >> dim rec1
    >> dim strsearch
    >> dim strConnect
    >>
    >> strConnect="DRIVER={PostgreSQL};
    >
    > Is there a native OLEDB provider for PostgreSQL that you could try instead
    > of ODBC? If so, I would try that first.
    >
    >> SERVER=localhost;DATABASE=SIC;UID=sa;PWD=**********;Socket=4096"
    >
    > You should not use your system administration account for your
    > applications.
    >
    >> set rec1=server.createobject("adodb.recordset") strsearch = "SELECT
    >> SIC, Description FROM tblSIC" rec1.open
    >> strsearch,strconnect,adopenforwardonly,adlockreadonly response.write
    >> "<table><tr><td
    >> width=120><b>SIC</b></td><tdwidth=600><b>Description</b></td></tr>"
    >> while not rec1.eof response.write "<tr>" Response.Write "<td
    >> align=center>" & rec1("SIC") & "</td>" Response.Write "<td
    >> align=center>" & rec1("Description") & "</td>" Response.Write
    >> "</tr>" x = x + 1 rec1.movenext wend Response.Write "<tr><td
    >> colspan=4 align=left><br>" if x = 0 then Response.Write "No records
    >> were found" elseif x = 1 then Response.Write x & " record found"
    >> else Response.Write x & " records found" end if Response.Write
    >> "</td></tr></table>" rec1.close set rec1=nothing%>When I open the
    >> page I get the following error message.Microsoft OLE DB Provider for
    >> ODBC Drivers error '80004005'ERROR: relation "tblsic" does not
    >> exist/dev.asp, line 20I have checked everything out and all seems
    >> correct. The connection stringworks fine in a UDL file but it doesn't
    >> seem to work in asp.
    >
    > The connection string does not appear to be the problem. You aren't
    > getting a connection faliure are you? You're getting an error after the
    > connection has been established. Does PostgreSQLhave any database
    > mangement tools to allow you to view connections or trace commands sent to
    > it? If so, I would use them to determine what is going on.
    >
    >> I can evencreate a dsn and export data from
    >> access to tblSIC with no problems. A pointto note is that somehow the
    >> asp code is looking for tblsic instead of
    >>tblSIC.
    >
    > Most databases I've worked with are case-insensitive. Is
    > PostgreSQLdifferent?
    >
    > Bob Barrows
    >
    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"
    >

    Thanks for the pointers, I did manage to find an OLEDB driver and it
    connected OK although it is very slow. The drivers are open source
    development ones so I may have to look at using another DB platform.

    The sa account is not a true sa account. The default sy admin account for
    PostgreSQL is actually called postgres. I just created the sa account for
    that specific database.

    Thnaks for your help.

    Paul


  • Next message: Anubis: "Help with connection.errors"

    Relevant Pages

    • Re: Help!! Event-IDs from Exchange, SQL and DNS...
      ... The Directory has given back the Error Server ... Please check Database connection ... Account is a preferred Account, ...
      (microsoft.public.windows.server.sbs)
    • Re: Postgre/PHP installation woes
      ... > But when we go to login to our PHP site, our login is rejected and we ... Is the login prompt not hitting the database? ... that connection seems to be broken and the first time it is used ... you postgresql isn't listening for TCP connections. ...
      (Debian-User)
    • Re: Converting MySQLdatabases to postgresql
      ... Most of my datan=bases are in MySQL, ... > uses PostgresQL. ... I have one set up, just as a backup system, the main database is in ... bet your socks that it is only the 'connection string' used in those ...
      (comp.os.linux.networking)
    • Re: How to setup STORE depository visible to the internet?
      ... This is a Microsoft Windows question more than a PostgreSQL or Smalltalk ... stop services (e.g. you are have an admin account). ... It owns the 'postgres database'. ... I use my own account as the store admin account. ...
      (comp.lang.smalltalk)
    • Re: Abstract Base Class means Abstract Composite/Aggregated Classes?
      ... that contains the version specicific knowledge of the database. ... we've got like100 different way to "process" an Account ... It would be up to a Dispatcher class to bring the two together. ... > connection object is something that he calls a Table Data Gateway. ...
      (comp.object)