Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > s there a module to acess Micorsoft Access datafiles?

Reply
Thread Tools

s there a module to acess Micorsoft Access datafiles?

 
 
Stan Brown
Guest
Posts: n/a
 
      07-18-2003
I find myself with the eed to obtain some data stored in Microsoft Access
format files from a perl script ruinning on a FreebSD box.

What's the best way to do this?

The files are actually on a Windows machien, but I can mount the partiton
using Samba.


--
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
-- Benjamin Franklin
 
Reply With Quote
 
 
 
 
Brian Helterline
Guest
Posts: n/a
 
      07-18-2003

"Stan Brown" <(E-Mail Removed)> wrote in message
news:bf9den$bom$(E-Mail Removed)...
> I find myself with the eed to obtain some data stored in Microsoft Access
> format files from a perl script ruinning on a FreebSD box.
>
> What's the best way to do this?
>
> The files are actually on a Windows machien, but I can mount the partiton
> using Samba.
>


Try the DBD:ODBC Module


 
Reply With Quote
 
 
 
 
William Alexander Segraves
Guest
Posts: n/a
 
      07-18-2003
"William Alexander Segraves" <(E-Mail Removed)> wrote in message
news:bf9lhr$mv7$(E-Mail Removed)...
> "Stan Brown" <(E-Mail Removed)> wrote in message
> news:bf9den$bom$(E-Mail Removed)...
> > I find myself with the eed to obtain some data stored in Microsoft

Access
> > format files from a perl script ruinning on a FreebSD box.
> >
> > What's the best way to do this?

>
> Win32::ODBC


Retracted. I see FreeBSD (which I originally missed), not Win32, as
platform.

Bill Segraves


 
Reply With Quote
 
William Alexander Segraves
Guest
Posts: n/a
 
      07-18-2003
"Stan Brown" <(E-Mail Removed)> wrote in message
news:bf9n42$f1b$(E-Mail Removed)...
> In <bf9lhr$mv7$(E-Mail Removed)> "William Alexander Segraves"

<(E-Mail Removed)> writes:
>
> >"Stan Brown" <(E-Mail Removed)> wrote in message
> >news:bf9den$bom$(E-Mail Removed)...
> >> I find myself with the eed to obtain some data stored in Microsoft

Access
> >> format files from a perl script ruinning on a FreebSD box.
> >>
> >> What's the best way to do this?

>
> >Win32::ODBC

>


Stan, please note I retracted this statement, on seeing what appeared to be
your objective.

>
> Correct me if I'm wrong, but wouldn't that have to run on the Windows

machine?
>


Yes. In addition, you'd have to set up a DSN on the Win32 machine to make it
possible for Win32::ODBC to access the files. See
http://www.roth.net/odbc/odbcfaq.htm for, well, FAQ stuff, on Win32.

> Perhaps I did not mention, the idea is to not have to do any more to the
> Windows box than mount it's share to get access to the files?
>


I understand. I wouldn't be at all surprised if you could do it that way. I
just haven't done it myself.

> Or am I on the wrong track here? I certainly will be the first to admit
> that I know nothing about the Windows side of things!


You may take a look at _Programming the Perl DBI_, Descartes, Alligator and
Bunce, Tim, "ODBC from Perl", pp. 167-172 for how to move a Perl script that
uses Win32::ODBC from Win32 to another platform.

If you want to try setting up a Win32 box to provide access to MS Access
files, you might try downloading and installing IndigoPerl, free from
www.indigostar.com, on the Win32 box. Note that you don't need to have MS
Access installed on the Win32 box to be able to access an MS Access file,
although it would certainly be helpful, especially if you need to generate
MS Access files for testing.

A couple of interesting projects I've encountered that may be helpful to
you:

1. #GUFE: Generic but Usable Front End
#by Aaron Weiss ((E-Mail Removed)) for the Web Developers' Virtual Library
# http://www.wdvl.com

2. # ODBC query - requires PERL 5.003_7 or higher and Win32::ODBC
# Author Alan Johnston - modified by WAS 11May2002
# Downloaded from http://www.roth.net/perl/scripts/scripts.asp?ODBCQry.pl

I'd certainly *like* to be in your situation, as my preference, at times,
would be to know as little as possible about Windows.

Cheers.

Bill Segraves






 
Reply With Quote
 
Stan Brown
Guest
Posts: n/a
 
      07-19-2003
In <bfa062$3rb$(E-Mail Removed)> "William Alexander Segraves" <(E-Mail Removed)> writes:

>"Stan Brown" <(E-Mail Removed)> wrote in message
>news:bf9n42$f1b$(E-Mail Removed)...
>> In <bf9lhr$mv7$(E-Mail Removed)> "William Alexander Segraves"

><(E-Mail Removed)> writes:
>>
>> >"Stan Brown" <(E-Mail Removed)> wrote in message
>> >news:bf9den$bom$(E-Mail Removed)...
>> >> I find myself with the eed to obtain some data stored in Microsoft

>Access
>> >> format files from a perl script ruinning on a FreebSD box.
>> >>
>> >> What's the best way to do this?

>>
>> >Win32::ODBC

>>


>Stan, please note I retracted this statement, on seeing what appeared to be
>your objective.



Yep, but I only saw the first post before sending the question.


>>
>> Correct me if I'm wrong, but wouldn't that have to run on the Windows

>machine?
>>


>Yes. In addition, you'd have to set up a DSN on the Win32 machine to make it
>possible for Win32::ODBC to access the files. See
>http://www.roth.net/odbc/odbcfaq.htm for, well, FAQ stuff, on Win32.


>> Perhaps I did not mention, the idea is to not have to do any more to the
>> Windows box than mount it's share to get access to the files?
>>


>I understand. I wouldn't be at all surprised if you could do it that way. I
>just haven't done it myself.


>> Or am I on the wrong track here? I certainly will be the first to admit
>> that I know nothing about the Windows side of things!


>You may take a look at _Programming the Perl DBI_, Descartes, Alligator and
>Bunce, Tim, "ODBC from Perl", pp. 167-172 for how to move a Perl script that
>uses Win32::ODBC from Win32 to another platform.


>If you want to try setting up a Win32 box to provide access to MS Access
>files, you might try downloading and installing IndigoPerl, free from
>www.indigostar.com, on the Win32 box. Note that you don't need to have MS
>Access installed on the Win32 box to be able to access an MS Access file,
>although it would certainly be helpful, especially if you need to generate
>MS Access files for testing.


>A couple of interesting projects I've encountered that may be helpful to
>you:


>1. #GUFE: Generic but Usable Front End
>#by Aaron Weiss ((E-Mail Removed)) for the Web Developers' Virtual Library
># http://www.wdvl.com


>2. # ODBC query - requires PERL 5.003_7 or higher and Win32::ODBC
># Author Alan Johnston - modified by WAS 11May2002
># Downloaded from http://www.roth.net/perl/scripts/scripts.asp?ODBCQry.pl


>I'd certainly *like* to be in your situation, as my preference, at times,
>would be to know as little as possible about Windows.


I works hard at it


Thanks.

I'll check those out.





--
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
-- Benjamin Franklin
 
Reply With Quote
 
Bart Lateur
Guest
Posts: n/a
 
      07-19-2003
Stan Brown wrote:

>I find myself with the eed to obtain some data stored in Microsoft Access
>format files from a perl script ruinning on a FreebSD box.
>
>What's the best way to do this?


Do it on a Windows box.

I'm sorry to say, but the MS Access file format is proprietary, and
undocumented. There's an interface built into all modern Windows
versions, so if you have one of those, you can access it.

Either you do it live (ODBC solution, see some DBI FAQs; or dbi-proxy
running on the Windows box), or you convert the data to a database which
you can use on FreeBSD.

HTH,
Bart.
 
Reply With Quote
 
James Willmore
Guest
Posts: n/a
 
      07-19-2003
> I find myself with the eed to obtain some data stored in Microsoft
> Access format files from a perl script ruinning on a FreebSD box.
>
> What's the best way to do this?


Use the appropriate DBD (aka Database Driver) that is used by the DBI
module (aka Database Interface Module).

>
> The files are actually on a Windows machien, but I can mount the
> partiton using Samba.


There is one issue to be addressed here - Access is NOT an RDBMS -
like MySQL, PostgreSQL, or Oracle. It "lives" on a local machine (aka
no ports/sockets are opened to allow for remote access to the database
file). So, the issue is first - "How do I in FreeBSD 'talk' ODBC?".
You need to use an application that will 'talk' ODBC - such as
UnixODBC. For more information about ODBC datasources and available
ports, check the FreeBSD website or your local FreeBSD newsgroup.

A way to get around the ODBC issue is to (depending on the size,
structure, etc) convert the Access database into a CSV file and use
the DBD::CSV module (or other CSV modules, or just 'roll your own') to
access the file. I suggest this because you mention you can mount the
Windows partition on your FreeBSD box. If the Access database is
small, converting to CSV should not be a problem. Then, using the DBI
module and the CSV driver, you could use the file as a 'real'
database, complete with using SQL to select, update, delete, etc. Not
the most efficient solution, but it is a solution.

Another way to do it is to install Perl on the Windows machine (since
it's a separate box) and then use DBI:roxy. This will allow you to
set up an ODBC DSN on the Windows box and allow the FressBSD box to
'connect' to the DSN. I can't say I've done it, but have read about
this as a solution.

One last solution is to take the database in Access and move it into
an RDBMS (such as MySQL or PostgreSQL - which FreeBSD has ports for
both). Then you could use Perl's DBI module and the appropriate DBD
module to access the database.

HTH

Jim
 
Reply With Quote
 
James Willmore
Guest
Posts: n/a
 
      07-19-2003
> I find myself with the eed to obtain some data stored in Microsoft
> Access format files from a perl script ruinning on a FreebSD box.
>
> What's the best way to do this?


Use the appropriate DBD (aka Database Driver) that is used by the DBI
module (aka Database Interface Module).

>
> The files are actually on a Windows machien, but I can mount the
> partiton using Samba.


There is one issue to be addressed here - Access is NOT an RDBMS -
like MySQL, PostgreSQL, or Oracle. It "lives" on a local machine (aka
no ports/sockets are opened to allow for remote access to the database
file). So, the issue is first - "How do I in FreeBSD 'talk' ODBC?".
You need to use an application that will 'talk' ODBC - such as
UnixODBC. For more information about ODBC datasources and available
ports, check the FreeBSD website or your local FreeBSD newsgroup.

A way to get around the ODBC issue is to (depending on the size,
structure, etc) convert the Access database into a CSV file and use
the DBD::CSV module (or other CSV modules, or just 'roll your own') to
access the file. I suggest this because you mention you can mount the
Windows partition on your FreeBSD box. If the Access database is
small, converting to CSV should not be a problem. Then, using the DBI
module and the CSV driver, you could use the file as a 'real'
database, complete with using SQL to select, update, delete, etc. Not
the most efficient solution, but it is a solution.

Another way to do it is to install Perl on the Windows machine (since
it's a separate box) and then use DBI:roxy. This will allow you to
set up an ODBC DSN on the Windows box and allow the FressBSD box to
'connect' to the DSN. I can't say I've done it, but have read about
this as a solution.

One last solution is to take the database in Access and move it into
an RDBMS (such as MySQL or PostgreSQL - which FreeBSD has ports for
both). Then you could use Perl's DBI module and the appropriate DBD
module to access the database.

HTH

Jim
 
Reply With Quote
 
Stan Brown
Guest
Posts: n/a
 
      07-19-2003
In <(E-Mail Removed)> James Willmore <(E-Mail Removed)> writes:

>> I find myself with the eed to obtain some data stored in Microsoft
>> Access format files from a perl script ruinning on a FreebSD box.
>>
>> What's the best way to do this?


>Use the appropriate DBD (aka Database Driver) that is used by the DBI
>module (aka Database Interface Module).


>>
>> The files are actually on a Windows machien, but I can mount the
>> partiton using Samba.


>There is one issue to be addressed here - Access is NOT an RDBMS -
>like MySQL, PostgreSQL, or Oracle. It "lives" on a local machine (aka
>no ports/sockets are opened to allow for remote access to the database
>file). So, the issue is first - "How do I in FreeBSD 'talk' ODBC?".
>You need to use an application that will 'talk' ODBC - such as
>UnixODBC. For more information about ODBC datasources and available
>ports, check the FreeBSD website or your local FreeBSD newsgroup.


>A way to get around the ODBC issue is to (depending on the size,
>structure, etc) convert the Access database into a CSV file and use
>the DBD::CSV module (or other CSV modules, or just 'roll your own') to
>access the file. I suggest this because you mention you can mount the
>Windows partition on your FreeBSD box. If the Access database is
>small, converting to CSV should not be a problem. Then, using the DBI
>module and the CSV driver, you could use the file as a 'real'
>database, complete with using SQL to select, update, delete, etc. Not
>the most efficient solution, but it is a solution.


>Another way to do it is to install Perl on the Windows machine (since
>it's a separate box) and then use DBI:roxy. This will allow you to
>set up an ODBC DSN on the Windows box and allow the FressBSD box to
>'connect' to the DSN. I can't say I've done it, but have read about
>this as a solution.


>One last solution is to take the database in Access and move it into
>an RDBMS (such as MySQL or PostgreSQL - which FreeBSD has ports for
>both). Then you could use Perl's DBI module and the appropriate DBD
>module to access the database.


I'm reading (perhaps incorectly) in what you are saying that thee is no
Windows way of providing a n ODBC server on the windows side, with the
access database as a data source.

Is this correct?

If not, could I not do this, and use DBI::ODBC?

--
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
-- Benjamin Franklin
 
Reply With Quote
 
James Willmore
Guest
Posts: n/a
 
      07-19-2003
On Sat, 19 Jul 2003 15:54:55 +0000 (UTC)
Stan Brown <(E-Mail Removed)> wrote:

>
> I'm reading (perhaps incorectly) in what you are saying that thee is
> no Windows way of providing a n ODBC server on the windows side,
> with the access database as a data source.
>
> Is this correct?
>
> If not, could I not do this, and use DBI::ODBC?


You can use ODBC easily if you are on a Windows box. ODBC, from my
understanding, is a Microsoft standard that has become mainstream.
So, in Windows, you can define a DSN and, from a Windows machine,
access the DSN. Access was intended to be used on a local machine.
It CAN be access through a variety of methods on a Windows network,
but it was originally desgned as a single user database.

The intent of the orignal post I made was simply this - if you use an
OS OTHER THAN Windows to use an Access database, the method to use the
database changes. You need to use something that talks to an ODBC
datasource. So, just mounting the Windows partition (through, say
Samba) is NOT enough. And to just use an ODBC Perl module is NOT
enough. The module needs some way to interact with the ODBC
datasource - since the datasource is just a file and ONLY a file (ie
it's not being served through a server). That's where the methods I
described in the previous post come into play.

You can use something like UnixODBC (and there's another package
whose name eludes me right now) to connect to the datasource - no
server required. But you CAN'T use something in Perl to just straight
away connect to the datasource - unless it's something like DBI:roxy
running on the Windows machine and using DBD::ODBC on the FreeBSD
machine to connect - which I described in the previous post.

That's my understanding of the whole proccess. If someone sees an
error in the way I'm describing it, please let me know. For now, your
questions may be more properly addressed in a FreeBSD newsgroup first
- since you need to set up a way for FreeBSD to access an ODBC
datasource.

HTH

Jim

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Settinup 802.ix authentication with cisco 2950 and Micorsoft IAS wisdom1999@gmail.com Cisco 2 01-27-2006 08:06 PM
How to set up a public acess point yar Wireless Networking 6 11-18-2004 08:32 PM
Adding Wireless acess point to existing network. Shawn Wireless Networking 1 10-17-2004 03:53 PM
micorsoft - correct spelling!! martmoover Computer Support 7 12-08-2003 10:13 PM
Help with Micorsoft Agent Roberto S. ASP General 0 09-11-2003 07:14 PM



Advertisments