1

I am having an issue and just can't seem to resolve it. I cannot get my postgresql connection string to work. Everything works fine with I create a DSN, but when I try to utilize the driver in a connection string I keep getting the datasource not found error. I have PostgreSQL ANSI(x64),PostgreSQL ODBC Driver(ANSI),PostgreSQL ODBC Driver(UNICODE),PostgreSQL Unicode(x64). In the connection string I use the Unicode one. Again, in the DSN and ODBC Manager it works great. But I am using classic ASP (in IIS7) to pull data from the dB and I keep getting error. People were referring me to the connection string site, and I've tried everything I can think of. To me, it looks perfect, but just can't get past that error. Here is the string that I am using:

cst = "Driver={PostgreSQL ODBC Driver(UNICODE)};Server=ipaddress;Port=5432;Database=dbname;Uid=uid;Pwd=pw;"

Please please help?

By the way, I'm new to this site, so if I do something wrong with this question, please let me know. Thanks so much.

3
  • 1
    I keep getting error. What is the exact text of the error message? Commented May 16, 2014 at 5:47
  • Here's the exact text of the datasource not found error: Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified Commented May 17, 2014 at 20:30
  • I know I don't have a default driver specified but don't know why it wont take my driver in connection string? Maybe do I need to install different versions. I have x64 because that it what my server is Commented May 17, 2014 at 20:32

2 Answers 2

3

As far as I know classic ASP has a 32-bit server executable.

That means you need the 32-bit ODBC driver, not the 64-bit one, as the driver must match the client architecture not that of the PostgreSQL server.

Install and select the 32 bit PostgreSQL ODBC driver.

Sign up to request clarification or add additional context in comments.

2 Comments

Aah, thanks so much. Do you know if there are any instruction sites or something? I installed from ftp.postgresql.org/pub/odbc/versions/msi/… and now Im getting "Specified driver could not be loaded due to system error 5: Access is denied" when loading asp page. Went into manager %SystemRoot%\syswow64\odbcad32.exe, but when try to add new DSN, getting "The setup routines for the PostgreSQL Unicode ODBC Driver could not be loaded due to a system error code 126: The specified module could not be found. (C:\Program Files(.86)\psqoODBC\0903\bil\psqlodbc35W.dll)"
That I'm afraid is beyond my ODBC-fu. Suggest posting a separate new question and linking back to this for context.
3

Just had the same exact problem. Here is how I got it working with classic ASP under IIS7:

  • Install Visual C++ 2010 X64:

https://www.microsoft.com/en-us/download/details.aspx?id=14632

  • Install PSQLODBC X64

http://www.postgresql.org/ftp/odbc/versions/msi/

  • Run windows ODBC Administrator (search for odbc in windows search)
  • In System DSN tab, create a connection to the Database and use the connection name in place of the connection string on the Classic ASP script

Update:

I was also able to get classic ASP to connect to PostgreSQL through a connection string:

DBConn.Open "DRIVER={PostgreSQL UNICODE(x64)};Server=server_ip;Port=5432;DATABASE=database_name;UID=database_username;PWD=user_password;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.