Solved

Best DSN-less connection

Posted on 2006-07-15
3
238 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 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

12 Experts available now in Live!

Get 1:1 Help Now