PDA

View Full Version : Processing forms to an access database


arahim
09-18-2000, 04:22 PM
If anyone could help me create a script..or direct me in the right direction to maybe find a ready made script it would be greatly apprciated..
below is a script..i and a friend of mine have been piecing togehter..theres something wrong with it.???
#
# Perl script that talks with Contact database using an
#

use DBI;
use Data: :Dumper;

#read and parse data

#connect to database
my $dbh = DBI->connect( "dbi:ODBC:Contact", "", "",
{RaiseError => 1, PrintError => 1, AutoCommit => 1} ) or
die "Unable to connect: " . $DBI::errstr . "\n";

# OK, connected, now insert to Client table.


# Insert a new customer.
#Column names are:
#Name
#Address
#City
#State
#Zip
#Website
#Email
#DayPhone
#EvePhone
#Comment


$ins = $dbh->prepare( qq{insert into Client
values ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )}
);


my @tal = (
name,
address,
city,
state,
zip,
website,
email,
dayphone,
evephone,
comment
);

print $ins->execute(@tal) . "c\my documents\contact.mdb";

$ins->finish;


# Finished

$dbh->disconnect;
exit;



------------------
~Asya

D1
11-04-2000, 07:22 PM
if you want it to go into a access database, then you'd be better off using asp to do it. it'd be much easier aswell..