Developers Tutorials in ASP, PHP, ASP.NET, JSP, Python AND Ruby
 
Classic ASP ASP.NET PHP/mySQL JSP/Servlet Ajax Ruby Python Cold Fusion Perl
  Home |   Topics |   Search |   Login / Register |   Rss Feeds


Topics
» Classic ASP
» ASP.NET
» PHP/mySQL
» JSP/Servlet
» Ajax
» Ruby
» Python
» Cold Fusion
» Perl
Search news
Search for:

My Account
Email:

Password:


Register
Forgot password?

Listed in ASPin.com




site statistics



How to create a local DSN (Data Source Name)



This tutorial shows you how to set up a LOCAL Data Source Name, or DSN. This means that if you set up a connection on your own home machine then you will be able to connect to the database though if you move your code and database onto a live internet websever you normally will need the dsn set up by your hosting company's server.

If you cannot get in touch with your hosting company you may want to connect to your database with a DSN-less connection.




Title: How to create a local DSN (Data Source Name)
Submit Date: Wednesday, May 07, 2008
Last viewed at: Tuesday, August 05, 2008
Today Hit: 2
All Time Hit: 69
Reviewed : 0 times
Voted : 0 times
Av. rating :
View tutorial

More latest headlines in Classic ASP
A popular way to display data from a recordset, especially a large one, is in a paged fashion. For example, when you ask for all the data from a table in your database, you can see about 20 records neatly arranged in a grid fashion, with the ability to go to the next page, previous page, and so on. This 10-Minute Solution is the first of a series of three articles covering how to incorporate this common interface in your pages. The three articles are separated in terms of ease of understanding and use, from the simplest to the most complex. This first article shows how to display data, hitting the server and database once for each page requested.

In Part I of this series, we saw how to create a VBScript class to query our database using the very fast GetRows() method, and return a recordset as a local array. In Part II, we extended the class to allow ADDing and UPDATEing a row in the database. In this Part III, we will expand the class further to allow pagination of the returned recordset.

In un precedente articolo abbiamo visto la tecnica per impostare la paginazione su query molto lunghe in termini di mole di dati ed abbiamo analizzato il sistema per affidare all'oggetto Recordset l'intero compito gestire la paginazione, ma questo sistema, attraverso ASP, funziona solo con database di casa Microsoft come Access ed SQL Server, ma non col database oggetto di questo articolo: MySQL.

First, I created a field in the RECORDS table named ALPHA. Then using Access and Word, I copied the first letters of each horse's name into the ALPHA field from the NAMES field. By using ALT-click-drag I was able to copy only the first letters and paste them as a group back into the ALPHA field.

I created a new table called "LETTERS" with a field called "ABC" with a record for each letter of the alphabet. When this table is displayed, each letter is hyperlinked to the list of records that have the matching letter in their ALPHA field.


Ordering the recordset returned from your Access database is very easy - simply specify the columns you wish to order using an ORDER BY clause. When using the ORDER BY clause, ordering will happen by default in Ascending order (lowest to highest value). To order from highest to lowest value all you do is simply add the DESC keyword.

Some examples of ordering using the ORDER BY clause can be seen below.


The code below pages the records returned from our database 'myLinks.mdb'. The table is called 'tblLinks' and has 3 fields, an 'ID' (autonumber field), a textfield called 'SiteName' and a memo field called 'URL'. This script can be easily modified to suit your requirements.

As an ASP developer, I am constantly looking for new source code examples that will help make my job easier. Of course, using someone else's examples is far simpler than enduring the pain of the development process.

One of the examples I have seen on various sites involves paging through recordsets on a web page N records at a time. Most developers want to do this rather than present the entire recordset on a single page. First, this has the advantage of making faster page loads for site visitors, and secondly it makes for nicer pages.


This page demonstrates how to retrieve a recordset divided up into pages, and to only select data from a specified page. It  does not in any way store a recordset or connection in memory when the page is not accessed unlike many solutions you will read about. The ADO properties that make this magic possible are .AbsolutePage, .PageCount and .PageSize.

Recordset paging is the process of breaking up a recordset into multiple "pages" of information for display. You've probably noticed that most well designed sites implement this feature, allowing you to navigate through a recordset to view a certain number of records at a time. Breaking the recordset data into pages allows for easy browsing by the user of the application and it also adds a professional touch. When I first started encountering this feature on the web a few years back, I immediately began working on how to implement it for myself. The leisure of being able to casually browse and navigate through the results of a query was wonderfull and a heck of a lot better than having a few hundred records dumped on my browser all at once.

Filling a combo box with results a database query is something that ASP developers need to do often. This script will present an example of how to do just this. It's something every beginner should read and implement!







What's New
Display Paged Recordset Data
GetRows VBScript Class - Part III: Paging the results
ASP & MySQL Record Paging
Ways to get Alphabetical Paging for your ASP scripts
Sorting Database Records
Recordset Paging Script
Paging through Records using a Stored Procedure
Paged Table Displays by Charles Carroll & Jeff Emrich
Recordset Paging with ADO 2.0
Fill A ComboBox with DB Information

Most Popular
Cross-Page Posting Example
Retrieving Column Names with values
How to modify expire date of a cookie
Storing and retrieving variables from application object
CGI Guestbook
Image downloading from remote servers in ASP
Displaying last modified date of any file
Generating random passwords
PHP control structures - do while
Extended GridView Control

Copyright © 2008 Powered by GNews Publisher Positive. All rights reserved. Contact Us - Load Time: 0.14 second(s)