homepage Welcome to WebmasterWorld Guest from 54.81.170.186
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Visit PubCon.com
Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
Please help, db connection problem using classic asp
newwavecafe




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

Hi
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.

 

macrost




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

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.

duckhunter




msg:3217503
 5:20 pm on Jan 12, 2007 (gmt 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.

aspdaddy




msg:3217570
 6:52 pm on Jan 12, 2007 (gmt 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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved