programming-examples/perl/Database/Insert value with OLE connection.pl

20 lines
438 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!c:/perl/bin
use Win32::OLE;
use Win32::OLE::Const 'Microsoft ActiveX Data Objects';
$table = "addresstable";
$conn = Win32::OLE->new("ADODB.Connection");
$rs = Win32::OLE->new("ADODB.Recordset");
$conn->Open("address");
$conn->Execute("INSERT INTO $table (firstname, lastname, address)
VALUES ('A','B', 'C')");
print "Content-type: text/html\n\n";
print "Record Added ...";
$rs->Close;
$conn->Close;