Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2001-07-17
14
Medium Priority
?
511 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 60 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. 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…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

715 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