Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions
 Discussion Forums
 HTML, XML, JavaScript...
 Software Reviews
 Editors,Others...
 Top100
 JavaScript Tutorials, ...
 Tutorials
 ASP, CSS, Databases...
 Discussion List
 FAQ, Roundup, Configure ...
 Authoring
 HTML, JavaScript, CSS...
 Design
 Layout, Navigation,...
 Graphics
 Tools, Colors, Images...
 Software
 Browsers, Editors, XML...
 Internet
 Domains, E-Commerce, ...
 WDVL Resources
  Intermdiate, Tutorials,...
 WDVL
 Discussion Lists, Top 100,...
 Technology Jobs


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Top 10 Articles
  1. Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions
  2. JavaScript Tutorial for Programmers
  3. Design
  4. JavaScript Tutorial for Programmers - Objects
  5. JavaScript Tutorial for Programmers - JavaScript Grammar
  6. JavaScript Tutorial for Programmers - Versions of JavaScript
  7. Cascading Style Sheets
  8. JavaScript Tutorial for Programmers - Embedding JavaScript
  9. JavaScript Tutorial for Programmers - Functions
  10. Authoring JavaScript
Domain Name Lookup
Search to find the availability of a domain name. Just enter the complete domain name with extension (.com, .net, .edu)

Perl Module Mania: DBI and DBD

September 13, 1999

Given our focus on a Windows-based database in this particular article, we will also work with the Windows version of Perl -- the most popular of which is the ActiveState port, also known as ActivePerl. In almost all respects that interest us, using ActivePerl is much the same as Perl 5 in a Unix environment.

One of the nice perks of ActivePerl is that it is easy to install additional Perl modules. ActivePerl's PPM, or Perl Package Manager, is a command-line interface with which you can simply request modules from ActivePerl's Internet site and they are automatically downloaded and installed. That's good because we need some Perl modules! We'll detail the process for Unix users next month, but if you are a Unix user with experience installing Perl modules already, this month's coverage will probably suffice.

No matter what database you intend to work with from Perl, be it Access or Oracle or MySQL and so on, you will want to install and use the Perl module DBI, or Database Independent Interface (but it's not called DBII!). The DBI module provides a simple and consist means of querying a database regardless of the source format of that database. This allows us Perl coders to query Oracle databases with the same Perl script that we query Access databases, for instance.

We'll look more closely at using DBI in Perl code soon -- but first you need to retrieve and install the DBI module. Assuming you have installed ActivePerl, launch an MS-DOS prompt in Windows and type "ppm" to launch the Perl Package Manager. From there you simply enter the command "install DBI" and PPM should take care of the rest.

PPM interactive shell (1.0.0) - type 'help' for available commands.
	PPM>install DBI
	Install package 'DBI?' (y/N): y
	Retrieving package 'DBI'...
	

Just how smart is this DBI module? How can it possibly know how to talk to Oracle databases, Informix databases, MS Access, and so on? In fact, DBI doesn't know any of this. DBI only knows how to talk to DBD. What??

DBD modules contain the "brains" for DBI ... thus there is a DBI module specifically written for each brand of database that you can query with DBI. For example, any database that can communicate via the ODBC protocol can be queried with DBI and the DBD::ODBC module. Alternatively, you could query an Oracle database with DBI and DBD::Oracle, a Sybase database with DBI and DBD::Sybase, and so on. If you're using a database we haven't mentioned here, check the current list of DBI Module Availability.

Since MS Access supports ODBC, we want to install the DBD::ODBC module. To do so, return to the Perl Package Manager:

PPM interactive shell (1.0.0) - type 'help' for available commands.
	PPM>install DBD-ODBC
	Install package 'DBD-ODBC?' (y/N): y
	Retrieving package 'DBD-ODBC'...

That's all ... finally, we are ready to code some Perl!

Preparing Microsoft Access
The Perl You Need to Know
A Simple Query


Up to => Home / Authoring / Languages / Perl / PerlfortheWeb




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers