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
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
#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