Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   s there a module to acess Micorsoft Access datafiles? (http://www.velocityreviews.com/forums/t870222-s-there-a-module-to-acess-micorsoft-access-datafiles.html)

Stan Brown 07-18-2003 06:14 PM

s there a module to acess Micorsoft Access datafiles?
 
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

Brian Helterline 07-18-2003 08:11 PM

Re: s there a module to acess Micorsoft Access datafiles?
 

"Stan Brown" <stanb@panix.com> wrote in message
news:bf9den$bom$1@reader1.panix.com...
> 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



William Alexander Segraves 07-18-2003 08:40 PM

Re: s there a module to acess Micorsoft Access datafiles?
 
"William Alexander Segraves" <wsegrave@mindspring.com> wrote in message
news:bf9lhr$mv7$1@slb6.atl.mindspring.net...
> "Stan Brown" <stanb@panix.com> wrote in message
> news:bf9den$bom$1@reader1.panix.com...
> > 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



William Alexander Segraves 07-18-2003 10:03 PM

Re: s there a module to acess Micorsoft Access datafiles?
 
"Stan Brown" <stanb@panix.com> wrote in message
news:bf9n42$f1b$1@reader1.panix.com...
> In <bf9lhr$mv7$1@slb6.atl.mindspring.net> "William Alexander Segraves"

<wsegrave@mindspring.com> writes:
>
> >"Stan Brown" <stanb@panix.com> wrote in message
> >news:bf9den$bom$1@reader1.panix.com...
> >> 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 (aaron@pobox.com) 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







Stan Brown 07-19-2003 03:08 AM

Re: s there a module to acess Micorsoft Access datafiles?
 
In <bfa062$3rb$1@slb9.atl.mindspring.net> "William Alexander Segraves" <wsegrave@mindspring.com> writes:

>"Stan Brown" <stanb@panix.com> wrote in message
>news:bf9n42$f1b$1@reader1.panix.com...
>> In <bf9lhr$mv7$1@slb6.atl.mindspring.net> "William Alexander Segraves"

><wsegrave@mindspring.com> writes:
>>
>> >"Stan Brown" <stanb@panix.com> wrote in message
>> >news:bf9den$bom$1@reader1.panix.com...
>> >> 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 (aaron@pobox.com) 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

Bart Lateur 07-19-2003 08:09 AM

Re: s there a module to acess Micorsoft Access datafiles?
 
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.

James Willmore 07-19-2003 03:11 PM

Re: s there a module to acess Micorsoft Access datafiles?
 
> 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::Proxy. 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

James Willmore 07-19-2003 03:18 PM

Re: s there a module to acess Micorsoft Access datafiles?
 
> 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::Proxy. 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

Stan Brown 07-19-2003 03:54 PM

Re: s there a module to acess Micorsoft Access datafiles?
 
In <20030719110411.3e407099.jwillmore@cyberia.com> James Willmore <jwillmore@cyberia.com> 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::Proxy. 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

James Willmore 07-19-2003 05:53 PM

Re: s there a module to acess Micorsoft Access datafiles?
 
On Sat, 19 Jul 2003 15:54:55 +0000 (UTC)
Stan Brown <stanb@panix.com> 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::Proxy
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



All times are GMT. The time now is 11:06 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57