use Win32::ODBC;
use Win32::OLE;
use Win32::OLE::Const 'Microsoft ActiveX Data Objects';
...
my $Conn = Win32::OLE->new('ADODB.Connection'); # creates a connection object
$Conn->Open("DSN=CA_mdb;UID=;PWD=;DBNAME=beca.mdb"); # opens the database connection
if ($updateflag == 0){
$cmd = "INSERT INTO user_data (email,key,csr) VALUES ('$user','$key','$csr');";
}
else{
$cmd = "UPDATE user_data SET key='$key',csr='$csr' WHERE (email = '$user');";
}
......
my $rc = $Conn->Execute("$cmd");
if (Win32::OLE->LastError()){
}
else{
print $user,"success!",br,br;
}
$Conn->Close;