473,408 Members | 1,761 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Using a MS Access Database?

Does PERL supports MS Access database?
Aug 9 '07 #1
4 2362
miller
1,089 Expert 1GB
You have posted your question under Perl Articles instead of the Perl Forum.
I have moved it across for you.

- MODERATOR
Aug 9 '07 #2
numberwhun
3,509 Expert Mod 2GB
Does PERL supports MS Access database?
Why yes, yes it does. In fact, Perl supports many databases, including flatfile type db's.

You will want to have a read of the DBI module description on CPAN. DBI is the module that interfaces with all of the popular databases, simplifying your interaction with the DB you wish to use.

Regards,

Jeff
Aug 9 '07 #3
yes it supports... see the following code for reference...

Expand|Select|Wrap|Line Numbers
  1. use DBI;
  2.  
  3. use strict;
  4. use warnings;
  5.  
  6. #######################################
  7. # Script Parameters
  8. #######################################
  9.  
  10. my $raj = $ARGV[0];
  11.  
  12. #######################################
  13. # open connection to Access database
  14. #######################################
  15.  
  16. my $dbh = DBI->connect('dbi:ODBC:driver=microsoft access driver (*.mdb); dbq=C:\pp\emp.mdb')
  17.     or die "Cannot connect: $DBI::errstr";
  18.  
  19. #prepare and execute SQL statement
  20.  
  21. my $rsth = $dbh->prepare(qq{SELECT emp.emp_id, emp.name, emp.designation, emp.start_date FROM emp});
  22. $rsth->execute or die $dbh->errstr;
  23.  
  24. my ($emp_id, $name, $designation, $start_date); # Declare columns
  25. $rsth->bind_columns(\$emp_id, \$name, \$designation, \$start_date);
  26.  
Aug 10 '07 #4
miller
1,089 Expert 1GB
Greetings crazy4perl,

Thank you for sharing your code to connect to a MS Access Database.

Please note that I've cleaned up your syntax and formatting some for you. Specifically, take note of the use of $dbh->errstr in the error conditions now. This is typically how one gets detailed information on a DBI error. Also, the line at the beginning should be "use strict;" and not "use STRICT;".

Kudos,
- Miller
Aug 11 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

38
by: Remco Groot Beumer | last post by:
Hello, I'm trying to decide if the following situation would be workable: Generate an MS Access Front End (which will run localy on client computers), which will link to a DBMS (SQL server or...
5
by: dananrg | last post by:
I've created a small company database where the tables reside in a SQL Server database. I'm using Access 2000 forms for a front end. I've got a System DSN set-up to SQL Server and am using links...
1
by: Matt Alanzo | last post by:
On another newsgroup an Access knowledgable party posted: >You should be able to connect an Access ADP to an existing SQLExpress >database running in SQLS 2000 compatibility mode. The only thing...
10
by: B Moor | last post by:
Host PC: Win SBS 2003 with 2.6 GHz processor and 1GB RAM SQL Server 2000 sp3 (or latest).MS Office 2k3 I have the access 2k3 front end running on server (this may get changed) and all was well...
8
by: Carl | last post by:
Hi, Using MS Access 2000, is it possible to run a UPDATE or INSERT SQL query using some form of conditional IF THEN ?? for example: SELECT * FROM Books IF EXISTS(Select Books.ID = 1)
6
by: Serious_Practitioner | last post by:
Good day all, and thank you in advance for your help. No - MANY thanks in advance for your help - I know nothing about using databases on Web servers. I am about to discuss a project with a...
4
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The...
10
by: Robert | last post by:
How do you get an accurate count of the number of records returned from a query when using linked tables. I have an access 2003 database as a front end to another access 2003 database that...
4
by: Bugs | last post by:
Hi everyone. I am trying to open a database which works fine using Access 2003, but when trying to open it on another PC that has Access 2002 I get the following error "This database is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.