Solved

Best DSN-less connection

Posted on 2006-07-15
3
244 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
[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
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

691 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