Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
i have a code it is written like this
#!/usr/bin/perl $first = $field{'first'}; $last = $field{'last'}; $address = $field{'address'}; $email = $field{'email'}; $phone = $field{'phone'}; $user = $field{'user'}; $pass = $field{'pass'}; use DBI; $dbh = DBI->connect("dbi:ODBC:'driver = Driver do Microsoft Access(*.m +db); dbq=test.mdb'"); print"<html><body><h1>this is a test</h1>"; $sql = qq{INSERT INTO Dreamcpu(FirstName, LastName, Address, Email, Ph +one, Username, Password) VALUES ('$first', '$last', '$adress', '$emai +l','$phone', '$user', '$pass');}; $rc = $dbh->do($sql); print"$rc record(s) were added.<p>"; $sth = $dbh->prepare("SELECT ID,FirstName,LastName,Address,Email,Phone +,Username,Password FROM Dreamcpu"); $sth->executive(); print"<table>\n"; print"<tr> <th>ID</th> <th>First</th> <th>Last</th> <th>Address</th> < +th>Email</th> <th>Phone</th> <th>User</th> <th>Password</th>\n"; while (@row = $sth->fetchrow_array) { print"<tr>"; foreach(@row) { print"<td>$_</td>"; } print"</tr>\n"; } print"</table>\n"; print"</body></html>"; $sth->finish; $dbh->disconnect;
when i goto the webpage i get the following error
CGI Error The specified CGI application misbehaved by not returning a complete s +et of HTTP headers. The headers it did return are: Can't locate object method "connect" via package "DBI" (perhaps you fo +rgot to load "DBI"?) at C:\Inetpub\wwwroot\cgi-bin\ line +12.

any ideas
i installed dbi

2002-05-07 kudra Changed title, added code tags
2003-02-20 jeffa added spaces to long lines
2005-10-14 jdporter moved to root node in SoPW; was originally posted as a reply to RE: Site How To. Also fixed (finished) the code tags.

In reply to error with CGI program: Can't locate object method "connect" via package "DBI" by wayko

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others rifling through the Monastery: (5)
    As of 2019-11-14 06:24 GMT
    Find Nodes?
      Voting Booth?
      Strict and warnings: which comes first?

      Results (76 votes). Check out past polls.