Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • Last Modified:

Best DSN-less connection

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
AndyPaige
Asked:
AndyPaige
1 Solution
 
GawaiCommented:
first and the last both are same. wat is the diff. ?
anyway, i suggest u use first method

0
 
Carl TawnSystems and Integration DeveloperCommented:
The second uses the Jet OLEDB driver, which should be faster than the ODBC driver used in the first and last.
0
 
AndyPaigeAuthor Commented:
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now