Solved

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

Posted on 2001-07-17
14
505 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

739 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