Solved

Perl and MS-ACCESS Databases

Posted on 1998-08-05
11
209 Views
Last Modified: 2010-03-05
I need some help with a good starting place on how to use PERL to access a database that is written using MS-ACCESS. I am still a rookie PERL programmer but have managed to make some flat file text databases.  

I am using the PERL version from Activestate.com for 95/NT.  I want to learn how to go about taking a sample MS-ACCESS database, say a simple table, use PERL to perhaps retrieve some information and say display the information.  My ultimate goal is to be able to create a web page and have a user input somthing they are looking for and display it back html....

I just need a good mentor out there to get me going.  What do I need to do?  I have heard you need to use Win32 ODBC on you PC to bind the file or somthing like that?  What steps to I need to do to get going?  

I have several books.. "Learnign PERL" "Advanced PERL" and "Programming PERL" books that I have purchased but it is very intimidating looking at these books somtimes and would appreciate some real guidance?  

Perhaps some simple examples laying around that you can also email me with......  

0
Comment
Question by:brewman
  • 7
  • 4
11 Comments
 

Author Comment

by:brewman
ID: 1209032
Edited text of question
0
 

Author Comment

by:brewman
ID: 1209033
Adjusted points to 550
0
 
LVL 5

Accepted Solution

by:
b2pi earned 550 total points
ID: 1209034
You need to first download and install the Win32::ODBC module (note that this will require a c compiler). You can get that, if you don't already have it, at:

http://www.perl.com/CPAN-local/authors/id/DAVEROTH/Win32odbc_v970208.zip

To find out if you have it, type the following in at a command line:

C:\> perl
use Win32::ODBC;

print "Yup, I've got it\n";
^Z

If that works, you've got  it.  Otherwise (errors like "Can't locate Win32/ODBC.pm" immediately after you type in the line that starts with use), you'll have to download and install it.

Once you've got it, read the readme file.  That will point you to test.pl that comes with the ODBC module, which is a little example of how to use it.

That should get you started. Remember, small steps.
0
 

Author Comment

by:brewman
ID: 1209035
OK.  I downloaded the files and followed the instruction in the readme file.  I know get a PARSE EXCEPTION error when executing
the test you gave me....

I know.. Small Steps..  How do I fix this error please?
0
 
LVL 5

Expert Comment

by:b2pi
ID: 1209036
OK, you did a full install?  What this means is that the version of Perl you're using, and the version of Win32::ODBC you're using don't match.

I'd guess you're unfortunately using the ActiveState perl?  Do you have either Visual C++ or Borland C++?  If so, go ahead and actually compile Win32::ODBC and then install it (Directions on how to do so should be in a file called INSTALL).

If you have no compiler, show the results of

c:\>perl -V

and we'll see what we can do.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:brewman
ID: 1209037
I found this on the error:
What does "Parse Exception" mean?
When Win32::ODBC is compiled it is compiled to run with a specific build of Win32 Perl. If Activeware makes internal changes to Win32 Perl that are not compatible with the specific build of Win32::ODBC you are using, you will see the infamous "Parse Exception" error. This simply means that you can not use the particular build of Win32::ODBC and Win32 Perl. This usually takes place if you upgrade to a newer build of Win32 Perl.
The solution is to either not upgrade to the newer build of Win32 Perl or wait for a newer build of Win32::ODBC. You can always recompile it yourself if you want.
----
How do use the files to compile with the newer build?  I don't have a C compiler.  Is there aleady a version that will work with the current build I have, which is 316.
or could you compile this for me and e-mail me at
Michael.C.Lammon@mci.com

Thanks!
0
 
LVL 5

Expert Comment

by:b2pi
ID: 1209038
Arghhh. I absolutely loath the ActiveWare port....

If you have a fast link, I'd recommend that you download

http://www.perl.com/CPAN-local/authors/id/GSAR/libwin32-0.12.zip

and

http://www.perl.com/CPAN-local/authors/id/GSAR/perl5.00402-bindist04-bc.zip

follow the instructions (first bindist, then libwin). You might want to grab the readme's also, although they're included in the zips.

In any case, follow the directions to install, purge your system of all activeware stuff ( :))
and Voila!  You'll have a real working perl, and a real working ODBC (plus DBD::ODBC as a bonus)

0
 

Author Comment

by:brewman
ID: 1209039
I found this on the error:
What does "Parse Exception" mean?
When Win32::ODBC is compiled it is compiled to run with a specific build of Win32 Perl. If Activeware makes internal changes to Win32 Perl that are not compatible with the specific build of Win32::ODBC you are using, you will see the infamous "Parse Exception" error. This simply means that you can not use the particular build of Win32::ODBC and Win32 Perl. This usually takes place if you upgrade to a newer build of Win32 Perl.
The solution is to either not upgrade to the newer build of Win32 Perl or wait for a newer build of Win32::ODBC. You can always recompile it yourself if you want.
----
How do use the files to compile with the newer build?  I don't have a C compiler.  Is there aleady a version that will work with the current build I have, which is 316.
or could you compile this for me and e-mail me at
Michael.C.Lammon@mci.com

Thanks!
0
 

Author Comment

by:brewman
ID: 1209040
Thanks.. Actually, I just found a beta compiled odbc.pll file and so I tried this and did not get the error's.  I ran the 'perl test.pl' and it ran through and said there is not any errors......

Well I will give it a try now...  I am sure you'll here from me again..

Thanks !!!!!

0
 

Author Comment

by:brewman
ID: 1209041
Thanks.. Actually, I just found a beta compiled odbc.pll file and so I tried this and did not get the error's.  I ran the 'perl test.pl' and it ran through and said there is not any errors......

Well I will give it a try now...  I am sure you'll here from me again..

Thanks !!!!!

0
 
LVL 5

Expert Comment

by:b2pi
ID: 1209042
I understand your rush to get going, but I'll warn you, ActiveWare is going to bite you again in the future :]

Since you don't really lose anything by using the standard version of perl, and stand to gain a lot (i.e. threads, compilation to c code, etc) you'll probably want to thing seriously about switching to the standard version.

Good luck.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now