Hiya All! I need help -- I recently changed to a different webhost who requires me to label my Access databases (i.e. DSN name). The thing is that I had the script below on my previous host and it worked fine and now I have to convert it to work with a DSN name ("ml"). Please help :-)
---- sub viewall { my $dbh; $dbh = CreateObject OLE "ADODB.Connection" or die "Can't create connec +tion to DataBase: $!" unless $dbh; $dbh->Open("Driver={Microsoft Access Driver (*.mdb)};DBQ==../../db/ml. +mdb"); my $rs = CreateObject OLE "ADODB.Recordset" or die "Can't adminmail da +tabase problemgfg"; my $sqlstatement = "SELECT firstname,lastname,company,title,email FROM + users"; $rs = $dbh->Execute( $sqlstatement ) or die print ( "Can't adminmail d +atabase problemdsds Perl says $!, DBI says ",$dbh::errstr,""); print <<ENDOF; <div align="center"> <center> <table border="1" cellpadding="4" cellspacing="0" bordercolor="#FFFF +FF" bordercolordark="#000080" bordercolorlight="#FFFFFF"> <tr> <td align="center"><font face="Verdana" size="2"><b>First Name</ +b></font></td> <td align="center"><font face="Verdana" size="2"><b>Last Name</b +></font></td> <td align="center"><font face="Verdana" size="2"><b>Company Name +</b></font></td> <td align="center"><font face="Verdana" size="2"><b>Title</b></f +ont></td> <td align="center"><font face="Verdana" size="2"><b>Email Addres +s</b></font></td> </tr> ENDOF while (!$rs->EOF()) { my $checkemail = $rs->Fields('email')->Value; my $fname = $rs->Fields('firstname')->Value; my $lname = $rs->Fields('lastname')->Value; my $cname = $rs->Fields('company')->Value; my $title = $rs->Fields('title')->Value; print <<END_OF_TEXT; <tr> <td><font face="Verdana" size="2">$fname</font></td> <td><font face="Verdana" size="2">$lname</font></td> <td><font face="Verdana" size="2">$cname</font></td> <td><font face="Verdana" size="2">$title</font></td> <td><font face="Verdana" size="2">$checkemail</font></td> </tr> END_OF_TEXT $rs->MoveNext; } print <<ENDOFB; </table> </center> </div> ENDOFB $dbh->Close(); admin(); }
--------- Thanks in advance! Surya

In reply to Need help with MS Access with Perl....... by sprakash

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.