Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIS, ASP, and Databases

Status
Not open for further replies.

DaPillow

Programmer
Jun 20, 2001
12
0
0
AE
I'm running IIS on win2000 Pro. anytime i try to connect to an access database on my computer thru an asp page, i get 'error 80004005: Data Source Name not found or driver not specifed' .
i searched around a bit, and found something saying it has to do with the permissions of the account (IUSR_MACHINE) that iis uses . i tried giving that account access to my web directory and database, but i still get the same error. Any ideas? thx...

 
daPillow,
show your connection string. 'cause problem is rather there.
If this were permissions problems, the error would've been 'access denied' or something.
 
Try this code
Set Connection=Server.CreateObject("ADODB.Connection")
dbPath=Server.MapPath("yourdatabase.mdb")
Connection.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="&dbPath

Const adOpenStatic = 3
Const adUseClient = 3
Const adLockPessimistic = 2

set rs=server.CreateObject("ADODB.Recordset")

sub ExecuteSQL(byval cmd)
if rs.State=1 then rs.Close
rs.CursorType = adOpenStatic
rs.CursorLocation = adUseClient
rs.LockType = adLockPessimistic
rs.Source = cmd
rs.ActiveConnection = Connection 'The record set needs to know what connection to use.
rs.Open
end sub

________
George, M
email : shaddow11_ro@yahoo.com
 
Source of the problem is that you are trying to use a DSN (Data Source Name) that has not been set up on the server that the code is running on.

Most likely, the application was developed on another pc -- and then ported over...

Set up the DSN just like it is on the PC where the script was created, and everything should work fine.

Or, like shaddow said, just use a DSN-less connection to make the code work on any machine regardless of whether or not a DSN has been set up.

:)
Paul Prewett
penny.gif
penny.gif
 
I tried a DSNless connection and it still didn't work. Also, i'm writing the application from scratch, and i set up the DSN myself, so that's not it either. I've seen dozens of posting about this very topic and no one seems to know the answer... thx anyway.
 
'error 80004005: Data Source Name not found or driver not specifed'

means that there is a problem with the DSN that you set up. There's nothing else that it can mean, so either

(a) it isn't set up at all on the machine where the script is running

or

(b) it's set up incorrectly because it doesn't know what driver to use.

Post your connection string and the code you use to open that connection, and I suspect we'll be able to help more.
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top