Solved

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

Posted on 2001-07-17
14
508 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
14 Comments
 
LVL 5

Expert Comment

by:mattyk
ID: 6290935
Application("LANSupport_ConnectionString") ="DSN=dsnName"

should do the trick I think

-matty
0
 
LVL 7

Expert Comment

by:daniel_c
ID: 6290936
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
ID: 6290938
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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
LVL 7

Expert Comment

by:John844
ID: 6290939
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
ID: 6290948
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
ID: 6290998
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
ID: 6291027
xxx.xxx.xxx.xxx is the ip address by the way :-)
0
 
LVL 33

Expert Comment

by:hongjun
ID: 6291863
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
ID: 6312990
ive tried this and unfortunatley doesnt work , any other ideas?
0
 
LVL 7

Expert Comment

by:daniel_c
ID: 6313366
-->
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
ID: 6313783
sorry Daniel c , tried this and no go .....
0
 
LVL 7

Accepted Solution

by:
daniel_c earned 15 total points
ID: 6315964
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
ID: 6316882
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
ID: 6318361
Actually { still curious }, what error message did you get?

Hopefully you can figure it out.
0

Featured Post

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 informatio…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

636 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