Hello! Here is what I am trying to do. I want users of my website to sign my guestbook which has to textarea fields for comments. What I have come to realize is that when I post more than around 256 characters into a Memo field in an MS Access database, it doesn't insert anything (no record at all).
There was a similar post a looong time ago but it doesn't sound like there was any definite solution. I know most people will not be using MS Access, but surely someone else has needed to use it and come across this problem. For your reference, the previous post was:
http://www.perlmonks.com/index.pl?node_id=39296&lastnode_id=3989
Now, for my code:
#!/usr/bin/perl
use strict;
use CGI::Carp qw(fatalsToBrowser);
use CGI qw(:all);
use CGI;
use DBI;
my $myCGI = new CGI;
print "Content-type: text/html\r\n\r\n";
my $name = $myCGI->param('txtName');
my $email = $myCGI->param('txtEmail');
my $country = $myCGI->param('txtCountry');
my $website = $myCGI->param('txtWebsite');
my $publicmessage = $myCGI->param('txtPublic');
my $privatemessage = $myCGI->param('txtPrivate');
my $dbh = DBI->connect('DBI:ODBC:whatever', 'whatever', 'whatever');
#$dbh->do("set textsize 25000");
#$dbh->{LongReadLen} = 50000;
#$dbh->{LongTruncOk} = 1;
my $sth = $dbh->prepare(q{
INSERT INTO tblGuestbook
(name, email, country, website, publicmessage, privatemessage, IP)
values
(?,?,?,?,?,?,?)
});
$sth->execute($name,$email,$country,$website,$publicmessage,$privateme
+ssage,$ENV{REMOTE_ADDR});
$sth->finish;
$dbh->disconnect;
Notice the three commented fields which I have tried to use with no luck.
I would greatly appreciate any comments (and code!) from anyone who has a solution to this.
Thank you!
Andrew
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
|
|