Results 1 to 6 of 6

Thread: With DSN vs DSN Less Database Connections

  1. #1
    Join Date
    Nov 2009
    Posts
    712

    With DSN vs DSN Less Database Connections

    Hello, I am learning java programming language. And while learning it, I have been confused about the two different types of connections available in java as With DSN and DSN Less Database Connection. If anyone know it in detail, then please provide some information about it, in java. I will be thankful to you for that. I have search same on internet, but I am not able to get the details about it, so please reply me with some information about it.

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    Re: With DSN vs DSN Less Database Connections

    Hello, if you are making use of the DNS less connection then you must need to make use of the code below and create a connection :
    Code:
     DataConn.Open "DBQ=" &  Server.Mappath("../_database/database.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"
    And for that you can simply make use of the code below if you are making use of the OLE connection with the Access 97:
    Code:
    DataConn.Open "Data Source=" & Server.Mappath("../_database/database.mdb") & ";Provider=Microsoft.Jet.OLEDB.3.51;"

  3. #3
    Join Date
    Oct 2005
    Posts
    2,393

    Re: With DSN vs DSN Less Database Connections

    If you are created the DSN ie. the Data Source Name then you can make use of the code below for creating the connection :
    Code:
    <%
    	Dim connection 
    		Set connection  = Server.CreateObject("ADODB.Connection")
    
    	connection .Open "DSN=mydsn"
    
    	' Database connection is successful
    	' Add your code here
    	'You will need to close the connection if you have done your work, so close it. 
    
    	connection .Close
    	Set connection  = Nothing
    %>

  4. #4
    Join Date
    May 2008
    Posts
    2,389

    Re: With DSN vs DSN Less Database Connections

    If you want to know the details about the With DSN vs DSN Less Database Connections, then you must need to first consider the need of both of this technique:
    Need of DSN Connections:
    • It will help you with the Data Source Name.
    • It will be helpful to you when the you need to hold the collection of Data sources with a central repository you can make use of it.

    Use of the DSN less Connections:
    • It is helpful to you when you are unable to register your own dsn.
    • As it uses the native OLE DB providers it provides the faster response to the database use.

  5. #5
    Join Date
    Feb 2008
    Posts
    1,852

    Re: With DSN vs DSN Less Database Connections

    Hello, if you want to create a connection with the database without the use of the DSN then you can simply able to make use of the code below:
    Code:
    <%
    	Dim connection 
    		Set connection  = Server.CreateObject("ADODB.Connection")
    
    	connection .Open "Provider=Microsoft.Jet.OLEDB.4.0; Data" & _
    		"Source=c:\path\to\database.mdb"
    
    	' You are connected with the open database.
    	' Add you all of the code here
    	'If you compete your coding then just close the connection 
    
    	connection .Close
    	Set connection  = Nothing
    %>

  6. #6
    Join Date
    Jan 2008
    Posts
    1,521

    Re: With DSN vs DSN Less Database Connections

    Hello, if you are making use of the DSN-less connections while making the database connection then you will able to work more faster than the use of the DSN connection while making the connection with the database. Though it is a similar in use, but the dsnless connection is not having any type of access to the registry during the connection process. Many times mostly the OLEDB connections are used over both of these connections. As the OLEDB connection will provide you more faster access to the database than these database connection.

Similar Threads

  1. What are the Persistent Database Connections in PHP?
    By Vandam in forum Software Development
    Replies: 5
    Last Post: 09-03-2010, 01:53 AM
  2. How to remote connections by MySQL database server
    By Arumugan in forum Software Development
    Replies: 4
    Last Post: 13-02-2010, 01:50 AM
  3. Creating Database link in database
    By Lachlann in forum Software Development
    Replies: 3
    Last Post: 28-01-2010, 01:17 PM
  4. convert filemaker pro database to access database
    By Czack in forum MS Office Support
    Replies: 3
    Last Post: 15-04-2007, 01:06 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,008,135.00697 seconds with 16 queries