Yes, you can use an Access database directly from perl. You need the DBI
modules. You also need to setup an ODBC connection to your access database
in the Windows Control Panel. Here is how I used to connect to my database
and get the local info about a domain. Replace between the [] with your
information:

use DBI;

$dbh = DBI->connect("DBI:ODBC:[you ODBC connection here]", , , { RaiseError
=> 1, AutoCommit => 1 });
$sth = $dbh->prepare("SELECT * FROM [your table name] WHERE [your row name]=
'$reg_domain'");
$rc = $sth->execute;
@rootArray = $sth->fetchrow_array;
$sth->finish;
$rc = $dbh->disconnect;

Variables:

$dbh = database Handle
$sth = statement handle
$rc = return code

Now, your row of data is stored in @rootArray. The fields are in
$rootArray[0], $rootArray[1], etc. Check out the DBI help file for the
details, but this should get you started. As you may have noticed, there's
not any error checking in the snippet above. You can check the values of
$rc, $dbc, and $sth right after they are assigned to see if the previous
statement failed.

Good Luck!

-Eric P.

-------------------------------------------------------
arctic bears - the internet - your way.
email hosting from US$8/month, domains from US$19/year.
http://www.arcticbears.com


----- Original Message -----
From: "Josh Spiegel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 25, 2001 10:26 PM
Subject: CGI Moron. Please help.


>
> Hi,
> I have been using the OpenSRS scripts on my sight by using Cold Fusion to
> pass the variables to the scripts.  Why do I do this?  Because I wanted to
> keep my own little database of what's going on at various points in the
> registration process.  It has all been going fairly well until now.  When
my
> customers make changes in manage.cgi to their password for example, my
> database does not get updated.
>
> Could somebody tell me how I can update my database in perl?  I am using
an
> access database (.mdb).  Is there a perl module for this?  Is there a
> tutorial for this? Cause I have had no luck searching the web.  I really
> would like to avoid breaking manage.cgi when I try to add some module that
> shouldn't be there.
>
> I don't want to have tell my customers that they are "out of luck" when
they
> forget their password.
>
> Thanks,
> Josh
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>


Reply via email to