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
Solved

Best DSN-less connection

Posted on 2006-07-15
3
242 Views
Last Modified: 2006-11-18
I am trying to find my best option for a DSN-less connection. The following 3 connection strings all work (thanks to the geniuses at EE who have helped me).

1. Which option is the best and why?
2. I will be putting the connection string in an include file. As I have 3 databases that are drawn on from different areas of the site, do I need to use and refer to 3 different include files with the separate connection string in each, or is it more efficient/possible to place the 3 pieces of code in one file and refer to this? I guess that would mean I am connecting to databases I don't need to each time if I do that, does it?

set Conn = server.createobject("ADODB.Connection")
Conn.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ= D:\Domains\redstudioweb.com\wwwroot\client\link\db1\positiondatabase.mdb"

set Conn = server.createobject("ADODB.Connection")
Conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= D:\Domains\redstudioweb.com\wwwroot\client\link\db1\positiondatabase.mdb"

set Conn = server.createobject("ADODB.Connection")
Conn.open "DBQ=" & Server.MapPath ("db1\positiondatabase.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"

Thank you for your advice :)
0
Comment
Question by:AndyPaige
3 Comments
 
LVL 20

Expert Comment

by:Gawai
ID: 17116526
first and the last both are same. wat is the diff. ?
anyway, i suggest u use first method

0
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 17117247
The second uses the Jet OLEDB driver, which should be faster than the ODBC driver used in the first and last.
0
 

Author Comment

by:AndyPaige
ID: 17117277
Thank you, that sounds like a good enough reason to use it.

I think I will use what the webhost recommended (the first) for now while I am trying to iron out permission issues with them, (on top of getting all this code right full stop) then swap to the OLEDB method later.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Suggested Solutions

Title # Comments Views Activity
Can not run ASP pages Windows 10 Edge browser. 5 105
How to display the different types of results from a Query 2 52
Button to go back 3 28
ASP/VB email question 4 46
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…
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…
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…

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