Hit enter to search or ESC to close
Thinking WordpressThinking WordpressThinking Wordpress
  • Tips n’ Tricks
  • Guides
  • Plugins
  • WordPress
  • Developing
  • SEO tips
  • Server
DSN Versus DSN Less Connection
Wordpress

DSN Versus DSN Less Connection

By John Allen May 27, 2022 No Comments

This article describes two ways of connecting Microsoft Access and PHP:

Approach 1

Using DSN

A Data source Name is a name that the ODBC uses to get the drive and other information that are vital for accessing 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.Type a DSN name.

DSN stores information required to connect to database.

-> Database type

->server location

->username and password

-> Connection options

Advantages:

1)Data source names are easier to remember and quite handy to use.

2)we want a central repository to hold the collection of data sources we are bound to use a DSN.

Disadvantages:

1)When ADO attempts to connect to a database using a System DSN it must perform a lookup in the registry. This lookup slower performance when there are many concurrent connections.

2)With DSN method, you will have to maintain two sets of settings: the script and the DSN itself.

3)ODBC driver for MS Access causes instability on the server.

Approach 2

Without using DSN(DSN-less method)

On the other hand when using DSN-less method we do not have to create a system level DSN for connecting to the database.

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

Advantages

1)Often it is difficult to register a DSN and its always better to connect to your databases directly.

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

3)For portability reasons, it would be better to use DSN-less method

Disadvantages

1)Global database changes require changes be pushed out to all Web site owners in order to maintain site functionality.

2) Database connection information can be stored in individual PHP files and any changes to it would have to be repeated throughout all the files.

Summary

Some people think that DSN-less is faster while other believe DSN is faster based on several other tests.But if you are using a small site that gets less hits a day then in that case you won’t see much difference between the System DSN and DSN-less connection.Both the methods are good as well as bad in their own respective ways.Its upto you to choose the one that suits your requirement.

Reference :Internet

HI! MY NAME IS YIANNIS
I live in Athens, Greece. I'm thinking and using Wordpress for the last 10 years. Every day, I learn something new and I'm here to share it with people who care.

What’s Trending

  • Link Building Tricks With CommentLuv and KeywordLuv May 26, 2021
  • How to build a WordPress starter package June 7, 2020
  • How to reduce your wordpress size April 16, 2020

Recently Written

  • MySQL Admin Password and Plesk Parallels 10Check What Is Best For You: Dedicated Server or VPS Server? March 13, 2023
  • 5 Simple Steps to Choose WordPress HostingSmall Business Web Hosting: What Is Grid Hosting? March 12, 2023
  • MySQL Admin Password and Plesk Parallels 10Do You Know Cloud Computing and Cloud Hosting? March 11, 2023
  • Previous PostHow to Get Free Web Hosting

  • Next PostSEO And PPC: A Powerful Combination

You May Also Like

Thinking of Updating Your WordPress Site to Gutenberg? Wordpress

Why Shared Hosting Is So Cheap?

John AllenNovember 29, 2022
Thinking of Updating Your WordPress Site to Gutenberg? Wordpress

How To Start Blogging: 7 Steps To Starting A Blog

John AllenNovember 29, 2022
Thinking of Updating Your WordPress Site to Gutenberg? Wordpress

Benefits to Hosting Your E-Commerce Site on A Dedicated Server

John AllenNovember 25, 2022

© 2024 Thinking Wordpress. All Right Reserved

  • Tips n’ Tricks
  • Guides
  • Plugins
  • WordPress
  • Developing
  • SEO tips
  • Server
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT