ODBC Connection

  • I have a perl app that happily retrieves from a MS-SQL database when run on the command line. However, when I run it from a web browser nothing is displayed. I fail to connect to the database.

    I believe it must be due to the browser not running as "my user" and running as the "web user", which does not have permission. Where can I check this?

    I feel that I'm really close. HELP:>

  • I believe it was Andy Warren that walked through this years ago on this site but you can use a neat utility to build and test your connection string right from the server that you are going to be connecting to the database from.

    On the desktop right click and create a new text document. Rename it to Connection.udl (or anything .udl). Double click on that and walk through the tabs to create your connection. Test the connection to make sure it works. When complete, close it out, right click on the file and select open with Notepad and you will have your connection string. Paste this in your code and you should be all set.

    Hope this helps. I know I have never had an issue with a connection string since. 🙂

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

  • and the link to Andy's article is - http://www.sqlservercentral.com/articles/Miscellaneous/introductiontotheadoconnectionobject/510/

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

  • Thanks for the link, but I can connect fine to the database and retrieve records when I run the Perl cgi script from the command prompt on the windows server. When I try to run the cgi script from a web browser I get the connection failed (Could not open connection to DSN because of [No such file or directory]). I'm sure they is somewhere I must tell the server that it's "web user" has access to this database. I have set the DSN up as a system DSN entry. But still no joy.

    I have a simular perl script on the server that works fine, but connects to a different database. Someone had sussed out how to resolve this, so it can be done. There must be a permission issue somewhere, but I don't know where to look, beyond all the obvious places.

  • Sorry for the misinformation. So, are you trying to pass through security information from the connecting user - or just from the web site - to the database?

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply