[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

3.4

Urgent Help needed to insert form fields into Access database!

Asked by Cherlene in Perl Programming Language

Tags: access, form, name

I can't seemed to insert all the fields entered by the user into the database. It always gave me this error "The following error occurred : Can't call method "prepare" on an undefined value at D:\fmp\Web\cgi-bin\dndregistration.cgi line 73. "

I can't seemed to resolve it, can anyone help it?

The cgi file is as follows :-
#!/usr/bin/perl

print "Content-type:text/html\n\n";

use Mail::Sender;
use CGI qw(:standard);      # Must be used to get the param() function
use DBI;            # Must be used for connecting to databases engine

$SIG{__DIE__} = \&Error_Msg;

sub Error_Msg {
  $msg = "@_";
  print "The following error occurred : $msg\n";
  exit;
}

$name = param("name");
$contact_no = param("contact_no");
$email = param("email");
$attending = param("attending");
$mealset = param("mealset");

($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
$mon += 1; # Ajust the month to a 1 to 12 format instead of a 0 to 11 format
$year += 1900; # $year is nb of years since 1900, so add up to 1900
$currentDate = "$year/$mon/$mday $hour:$min:$sec";

$myEmail1 = 'abc@hotmail.com';
$mySMTPserver = '172.29.91.18';

sub template {
local(*FILE);         # filehandle
local($file);         # file path
local($HTML);         # HTML data
$file = $_[0] || dienice("Template : No template file specified\n");
open(FILE, "<$file") || die("Template : Couldn't open $file : $!\n");
while (<FILE>) { $HTML .= $_; }
close(FILE);
$HTML =~ s/\$(\w+)/${$1}/g;
return $HTML;
}

ref ($sender = new Mail::Sender { from => $email,
     smtp => $mySMTPserver})
or die("Error($sender) : $Mail::Sender::Error\n");

$sender->Open({to => $myEmail1, subject => "Annual Dinner & Dance 2000 - Registration Form"});
$sender->SendLine("This request form was sent on: " . $currentDate);
$sender->Send("\n");
$sender->SendLine("Applicant Information");
$sender->SendLine("----------------------------------------");
$sender->SendLine("Name : " . $name);
$sender->SendLine("Contact Number : " . $contact_no);
$sender->SendLine("Attending : " . $attending);
$sender->SendLine("Choice of set : " . $mealset);
$sender->Send("----------------------------------------");
$sender->Close;

#------------------------------------------------------------------------
# This section is for appending the data to the database.
sub new_record {
      # This function add a record to the db
      my ($currentDate, $name, $email, $contact_no, $attending, $mealset) = @_;      # Get arguments

      my ($dbh, $sth, $sql, $rv);
      $dbh = DBI->connect( q{DBI:ODBC:dnd_DB},
                        {RaiseError => 1,
                        PrintError => 1,
                        AutoCommit => 1} );
      
      $sql = q{INSERT INTO tblregistration VALUES (?,?,?,?,?,?)};
      $sth = $dbh->prepare( $sql );

      $ rv = $sth->execute($currentDate, $name, $email, $contact_no, $attending, $mealset);

      my $success = 1;
      $success &&= $rv;

      $dbh->disconnect;
      return $success;
}
# This function appends the data to the db
if (new_record($currentDate, $name, $email, $contact_no, $attending, $mealset)) {

#------------------------------------------------------------------------
# This section prints a thanks-for-being-so-nice message

print &template("Adnd/2000/thankyou1.html");      #Prints the content of this html file

}
 
Related Solutions
Keywords: Urgent Help needed to insert form field…
 
Loading Advertisement...
 
[+][-]04/09/03 02:54 PM, ID: 8303107Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Perl Programming Language
Tags: access, form, name
Sign Up Now!
Solution Provided By: SpideyMod
Participating Experts: 8
Solution Grade: B
 
[+][-]11/16/00 02:35 AM, ID: 5383081Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/16/00 02:55 AM, ID: 5383335Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/16/00 03:09 AM, ID: 5383484Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/16/00 04:45 AM, ID: 5385302Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]11/16/00 04:45 AM, ID: 5385303Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/16/00 07:13 AM, ID: 5389060Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/16/00 08:49 AM, ID: 5391919Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/16/00 09:56 AM, ID: 5393867Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/16/00 12:16 PM, ID: 5397539Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/16/00 08:42 PM, ID: 5408321Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/16/00 09:59 PM, ID: 5408979Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/16/00 11:01 PM, ID: 5409528Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/17/00 12:21 AM, ID: 5410169Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/17/00 01:03 AM, ID: 5410591Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/17/00 01:08 AM, ID: 5410625Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/20/00 08:51 PM, ID: 5467800Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/21/00 10:05 PM, ID: 5495520Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/22/00 08:53 AM, ID: 5507479Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/23/00 03:52 AM, ID: 5526880Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/27/00 05:47 AM, ID: 5592900Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/28/00 12:50 AM, ID: 5619719Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/28/00 08:32 AM, ID: 5630559Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/30/00 06:56 AM, ID: 5685966Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/30/00 06:58 AM, ID: 5686009Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/30/00 11:49 PM, ID: 5706048Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/01/00 03:01 AM, ID: 5708367Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/01/00 03:17 AM, ID: 5708532Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/14/01 10:36 PM, ID: 5844696Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/19/01 09:00 PM, ID: 5942426Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/21/01 04:27 AM, ID: 6409387Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92