Dricenak.com

Innovation right here

Shopping Product Reviews

DSN vs. DSN less connection

This article describes two ways to connect Microsoft Access and PHP:

approach 1

DSN Usage

A data source name is a name that ODBC uses to obtain drive and other information that is vital to accessing the data. To create a DSN, go to the control panel. Choose Administrative Tools and select ODBC. Select System DSN and Add. Select a database driver. Click finish. Enter a DSN name.

DSN stores the information required to connect to the database.

-> Database type

-> server location

->username and password

-> Connection options

advantage:

1) Data source names are easier to remember and very convenient to use.

2) we want a central repository to store the collection of data sources that we are required to use a DSN.

Disadvantages:

1) When ADO tries to connect to a database using a System DSN, it must perform a registry lookup. This search performance is slower when there are many concurrent connections.

2) With the DSN method, you’ll need to maintain two sets of configurations: the script and the DSN itself.

3) ODBC driver for MS Access causes server instability.

approach 2

Without using DSN (DSN-less method)

On the other hand, when we use the DSN-less method, we don’t have to create a system-level DSN to connect to the database.

All connection details are included in the connection string in the script itself.

Advantage

1) It is often difficult to register a DSN and it is always better to connect directly to their databases.

2) It provides faster database access because it uses native OLE DB providers, while DSN connections use ODBC drivers.

3) For portability reasons, it would be better to use the method without DSN

Disadvantages

1) Global database changes require changes to be pushed to all website owners to maintain site functionality.

2) Database connection information can be stored in individual PHP files and any changes made will have to be repeated across all files.

Resume

Some people think that DSN-less is faster while others think that DSN is faster based on various other tests, but if you are using a small site that gets fewer hits per day then in that case you won’t see much difference between the system DSN and connection without DSN Both methods are good and bad in their respective ways.

Reference: internet

LEAVE A RESPONSE

Your email address will not be published. Required fields are marked *