Solved

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

Posted on 2001-07-17
14
503 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
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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

860 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