Fiji, the first answer is correct, but I'll explain a bit to get you started. First of all, we like to encourage people to try to help themselves first, it's better for everyone that way. When you get stuck, simply explain as much as you can (where you've searched for the answer, and what the error is) and make sure that you post code examples. This allows us to help you more efficiently (and accurately.)

First of all, you will need to install the DBI.pm and the DBD-ODBC.pm from CPAN. There are lots of documentation that comes with Perl and with the modules, so specific questions can usually be answered there. Here is a quick code example for hitting an Access DB locally.
#!/usr/bin/perl -w use strict; #Make sure you always use strict! use DBI; #This implements the DBI.pm # Connect to the Access database called 'db1.mdb' my $DSN = 'driver=Microsoft Access Driver (*.mdb);dbq=db1.mdb'; my $dbh = DBI->connect("dbi:ODBC:$DSN") || die "Couldn't open database +: $DBI::errstr; stopped"; # Prepare the SQL query for execution # From the TEST_TBL return all values for FIELD1,FIELD2,FIELD3 my $SQL1 = $dbh->prepare(<<End_SQL) || die "Couldn't prepare statement +: $DBI::errstr; stopped"; select FIELD1, FIELD2, FIELD3 FROM TEST_TBL End_SQL # Execute the query $SQL1->execute() || die "Couldn't execute statement: $DBI::errstr; sto +pped"; # Fetch each row and print it while ( my ($field1, $field2, $field3) = $SQL1->fetchrow_array() ) { print "Found: $field1 - $field2 - $field3"; } # Disconnect from the database $dbh->disconnect();


Fiji, I suggest that you get an account here at Perl Monks and participate. It will help you learn more about Perl, and it's a good community to participate with. Good luck.

- Mission
"Heck I don't know how to do it either, but do you think that's going to stop me?!!"

In reply to Re: Writing to a DB in Windows Perl by Mission
in thread Writing to a DB in Windows Perl by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.