Click to See Complete Forum and Search --> : ASP dreamweaver connection.. DSN or OLEDB?


yinyang042
08-31-2006, 02:48 PM
I am attempting to learn how to develop asp pages in dreamweaver. My problem is that I am attempting to my college rugby team's site. I dont know what connection I need, either a DSN or a OLEDB connection to send this access database?

I am also attempting to learn how this works because I have my testing server at C:/inetpub/wwwroot/database/

I am not sure how it uploads and works correctly because Im real puzzled when I was looking through tutorials and found that the connection.asp file that is made when you connect via DSN looks almost the same as the one that is up on the internet except for one line:

MM_rugby_data_STRING = "DRIVER{Microsoft Access Driver (.mdb)} DBQ=" & Server.MapPath("/db_bin/rugby_data.mdb") & ";"

I understand that I need this line of code I just do not know how to obtain it and how to correctly connect so that I can make sure everything works correctly when I upload.

Can you please shed some light on this! :)

russell_g_1
09-03-2006, 09:52 AM
the reason that your examples look almost identical is because they are designed to be.

the recordset and connection objects provided by ado abstract away from the differences between databases and connection types. so if you connect to an access db or a sql 2005 db or an oracle they all look exactly the same in your asp code.

using an odbc dsn is just another abstraction. it lets you create a name for your database on your pc so you can reference it from any application on that pc using its name and hiding all the other details like default db, username, password, location, etc. so you probably don't need a dsn if all you are doing is running a single application.

it is also possible to use odbc to connect directly to the database without using a dsn. this is like your example above.

the other way to connect is via oledb (which is what i'd choose). this is also done without a dsn. i've read before that this is the best method for connecting to an access db, however i can't remember any of the reasons.

www.connectionstrings.com is a good place to lookup exactly what you're after.