Solved

Best DSN-less connection

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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/…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

929 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now