ok really stupid question but Dsn how?

P

prisoner206

Guest
how do you create a data source name and what would it be?

the file im trying to point towards is called access.mdb and its in the main directory im just unsure of how to work this.

i can seem to get everything else except this.
 
U

[UKLans]Khan

Guest
A Data Source Name is the instruction that tells the script where to find the database. There are 2 types of DSN:

1. DSN-Less - This specifies where the database is in location [Be it full path or map path]. What script are you using? ASP? if so this would be:

strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("access.mdb")

2. DSN Connection - This is where to tell the system where the database is, it isd said that this connection is faster but I think you would be talking micro, micro seconds :). You would have to go into the control pannel of the machine your hosting the website on. Find ODBC connections and setup a System DSN, the code would be something like this:

SET CN=SERVER.CREATEOBJECT("ADODB.CONNECTION")
CN.OPEN "DSN=THEDSNNAME"

I use the latter, most hosting companies give you a on-line way of creating system DSN's.

Hope this helps,

Khan
 

Users who are viewing this thread

Similar threads

B
Replies
9
Views
703
TheJkWhoSaysNi
T
T
Replies
2
Views
573
tris-
T
O
Replies
10
Views
721
Tempy_Incursion
T
T
Replies
44
Views
2K
Jonty
J
Top Bottom