Solved

Data Source Name not ffound ...... Using DBQ and server.mappath

Posted on 2001-07-17
14
495 Views
Last Modified: 2007-12-19
Hi im trying to connect to a db using ASP ,its some code i got from the web.

This is the connection line from the code

Application("LANSupport_ConnectionString") = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.mappath("support.mdb")


i still come up with the error no matter how often i change the area where it says Support .mdb ,

how can i find out what the server.mappath is?

how can i change the line to use a dsn while still keeping the part :

Application("LANSupport_ConnectionString") =

im not sure how to do this , any bright ideaS? :-)

thanks

S

0
Comment
Question by:sgriffin
14 Comments
 
LVL 5

Expert Comment

by:mattyk
Comment Utility
Application("LANSupport_ConnectionString") ="DSN=dsnName"

should do the trick I think

-matty
0
 
LVL 7

Expert Comment

by:daniel_c
Comment Utility
Server.MapPath is the physical folder where your website is located.

For examples:
If you put your site (http://www.abcsomething.com) in E:\Pub\ABC, then server.mappath("support.mdb") will contains this value: "E:\Pub\ABC\support.mdb".
0
 
LVL 11

Expert Comment

by:jekl2000
Comment Utility
DBQ=" & server.mappath("support.mdb")
This means that the db is in the same directory as your asp.  If it is in another dir...server.mappath("../otherdir/support.mdb")or you can use the real path

DBQ=" d:\inetpub\wwwroot\database\support.mdb"



0
 
LVL 7

Expert Comment

by:John844
Comment Utility
to see what the value is, use response.write Application("LANSupport_ConnectionString") on an asp page

to use a DSN
Application("LANSupport_ConnectionString") = "FileDSN=SomeDsn"

or
Application("LANSupport_ConnectionString") = "DSN=SomeSystemDSN"
0
 
LVL 7

Expert Comment

by:daniel_c
Comment Utility
If you know exactly where your MDB file is located, you can use:

Application("LANSupport_ConnectionString") = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\db\support.mdb"

(Assume your mdb file is in c:\db).
0
 
LVL 2

Author Comment

by:sgriffin
Comment Utility
Hi all , the url i have is http://xxx.xxx.xxx.xxx/sgtest/code205

And on the server the virtual folder sgtest is located at

d:\sg

within this is

d:\sg\code205\

and the db is in

d:\sg\code205\db\support.mdb

Ive tried your suggestions and would prefer to use a dsn but the dsn suggestions do not work when i try them now.....
0
 
LVL 2

Author Comment

by:sgriffin
Comment Utility
xxx.xxx.xxx.xxx is the ip address by the way :-)
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 33

Expert Comment

by:hongjun
Comment Utility
Try this
Application("LANSupport_ConnectionString") = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.mappath(".\code205\db\support.mdb")

hongjun
0
 
LVL 2

Author Comment

by:sgriffin
Comment Utility
ive tried this and unfortunatley doesnt work , any other ideas?
0
 
LVL 7

Expert Comment

by:daniel_c
Comment Utility
-->
and the db is in
d:\sg\code205\db\support.mdb

Application("LANSupport_ConnectionString") = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=d:\sg\code205\db\support.mdb"
0
 
LVL 2

Author Comment

by:sgriffin
Comment Utility
sorry Daniel c , tried this and no go .....
0
 
LVL 7

Accepted Solution

by:
daniel_c earned 15 total points
Comment Utility
What error message did you get?
For complete ADO connection, refer to this:
http://www.able-consulting.com/ADO_Conn.htm
0
 
LVL 2

Author Comment

by:sgriffin
Comment Utility
Hi , im awarding this to Dainiel C as he has spent a while with me on this , im going to have a thoroguh look at the site recommended as it looks v good , im still not sure why i cant get on but thanks everyone for assistance offered!
0
 
LVL 7

Expert Comment

by:daniel_c
Comment Utility
Actually { still curious }, what error message did you get?

Hopefully you can figure it out.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now