Free Newsletters:
DatabaseJournal  
DBANews
Database Journal
Search Database Journal:
 
MS SQL Oracle DB2 Access MySQL PostgreSQL PHP SQL Etc SQL Scripts & Samples Links Database Forum DBA Videos
internet.com

» Database Journal Home
» Database News
» DBA Videos
» Database Articles
» Database Tutorials
MS SQL
Oracle
MS Access
MySQL
DB2
» RESOURCES
Database Tools
SQL Scripts & Samples
Links
» Database Forum
» DBA Jobs
» Sitemap

News Via RSS Feed



follow us on Twitter

Marketplace Partners
Be a Marketplace Partner




internet.commerce
Be a Commerce Partner


















FCC's Martin: Open Networks Becoming the Norm

Enterprise SaaS Buyers Want More Than Uptime

Cuban Waves Off SEC Allegations

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

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


Database Journal | DBA Support | SQLCourse | SQLCourse2 | Swynk







Senior Developer (.NET)
Professional Technical Resources
US-CA-Santa Cruz

Justtechjobs.com Post A Job | Post A Resume

Featured Database Articles

MS Access

September 13, 1999

Dabbling in Live Databases: MSAccess

By Aaron Weiss

Perl Module Mania: DBI and DBD

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!

Go to page: Prev  1  2  3  4  5  6  7  Next  

Tools:
Add databasejournal.com to your favorites
Add databasejournal.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed

MS Access Archives







Latest Forum Threads
MS Access Forum
Topic By Replies Updated
Upload WebForm to Access orangeservice 0 November 18th, 11:33 AM
Work with variable makpk 1 November 13th, 01:49 PM
Using Filter on Report makpk 1 November 13th, 01:43 PM
Web Service help. carlos 0 November 12th, 05:45 AM








internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers