Welcome to WebmasterWorld Guest from

Forum Moderators: ocean10000

Message Too Old, No Replies

Please help, db connection problem using classic asp

10:45 pm on Jan 9, 2007 (gmt 0)

New User

10+ Year Member

joined:Apr 9, 2006
votes: 0

I'm in a bit of a situation. I've agreed to what I thought would be a very simple piece of development for a web designer friend of mine who has a dead line for tomorrow.

It's just a very simple CMS for one page. However I haven't had a chance to start the coding yet because I have spent all day trying to connect to the client database. Here are the problems:

1. The sql server doesn't allow remote access. It's all done through a web interface
2. I have no ftp details, they are all encrypted in a dreamweaver export.
3. I've never used dreamweaver before.
4. All of their current pages are in asp.net and I only know asp.

Looking at the web.config file I can see the database server name/db name/user name and password. So I have tried to use these details in a classic asp page:

Set gobjDB = CreateObject("ADODB.Connection")
gobjDB.mode = 3
gobjDB.Open "DSN=dbname;UID=username;PWD=password;"

But I get the error "Data source name not found and no default driver specified" suggesting the DNS hasn't been set-up. But if this is the case why does it work with the current live asp.net pages?

Any help on how I can connect to the db using classic asp would be greatly appreciated.

Many thanks.

8:12 pm on Jan 11, 2007 (gmt 0)

Preferred Member

10+ Year Member

joined:Feb 27, 2003
votes: 1

Well, one thing is that the live site has a DSN setup on the server, so the code can connect. If you are trying to develop on your personal computer, then you need to create a DSN, but I can't remember if you can connect to a datasource over the wire.
5:20 pm on Jan 12, 2007 (gmt 0)

Preferred Member

10+ Year Member

joined:Oct 28, 2002
votes: 0

There is more than one type of DSN. You need to make sure it is setup as a 'System DSN' not a 'User DSN'.

That allows any windows user to connect using that DSN. If it is setup as a 'User DSN' under your Windows account then the IUSR account that IIS uses cannot see it.

6:52 pm on Jan 12, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 13, 2002
votes: 0

Looking at the web.config file I can see the database server name/db name/user name and password.

Then the site isnt using a dsn is it, if it was those details would be in the dsn not in web.config.

The connection you wrote tries to use a dsn that doesnt exist thats why you get an error.

Ask for some info from the database person, once you know how the SQL authenticates requests from the web app you can decide how to connect & write the appropriate connection string.


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members