ADO, DSN, ASP - HELP

A

ACase

Hello,

This question may not be particular to this site, but since this community
has been so helpful in the past, I thought I would give it a try.

I have an asp web app, that is connecting to an Access DB.

The connection is done through the following function. However I keep
receiving a 'Data source name not found and no default driver specified'
error message. So there is something wrong with my syntax.

Can anyone help with the proper connection settings. Thanks ahead of time.

Function GetConnection()
dim objCon
Set objCon = Server.CreateObject("ADODB.CONNECTION")
objCon.Mode = 3
objCon.Open
"DSN=Kiosk;DBQ=C:\Inetpub\wwwroot\bony\kiosk.mdb;DriverId=25;FIL=MS
Access;MaxBufferSize=2048;PageTimeout=5;UID=admin;"

if objCon.State<>0 then
Set GetConnection = objCon
Else
Set GetConnection = nothing
end if
End function
 
S

Sylvain Lafontaine

Connection strings:

http://www.carlprothman.net/Default.aspx?tabid=81

http://www.connectionstrings.com/

Remove the DSN=Kiosk if this DSN has not been etablished by your IIS
provider (and replace the very old ODBC driver that you are trying to use
with the more recent JET OLEDB 4.0 Provider).

Also, make sure that your database is really located at
C:\Inetpub\wwwroot\bony\kiosk.mdb. Use the function Server.MapPath ("/") if
necessary.

Finally, the newsgroup about ASP and databases is
microsoft.public.inetserver.asp.db .
 
A

Amy Blankenship

Just be careful, if you do change drivers. You may see slight differences in
syntax, especially in the Like clause.

HTH;

Amy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top