Kram
05-19-2004, 12:25 AM
I have the following code which connects to a database (tested and works)...
But it does not seem to INSERT data the way i want it to. I think the INSERT statement is correct but when I open up the database, the records not there.
use strict;
use PDF;
use Win32::OLE;
#connect to database
my $conn = Win32::OLE->new("ADODB.Connection");
$conn->open("DSN=Properties");
#pdf to look at
my $pdf = PDF->new()
|| die "Can\'t create PDF parser";
$pdf->TargetFile("e:\\mark\\web\\dev\\database\\document 1.pdf");
#extract properties from pdf
my $title = $pdf->GetInfo('Title');
my $author = $pdf->GetInfo('Author');
my $keywords = $pdf->GetInfo('Keywords');
#insert values into database
$conn->Execute("INSERT INTO Properties(Title) values (?)",undef,($title));
$conn->Close();
But it does not seem to INSERT data the way i want it to. I think the INSERT statement is correct but when I open up the database, the records not there.
use strict;
use PDF;
use Win32::OLE;
#connect to database
my $conn = Win32::OLE->new("ADODB.Connection");
$conn->open("DSN=Properties");
#pdf to look at
my $pdf = PDF->new()
|| die "Can\'t create PDF parser";
$pdf->TargetFile("e:\\mark\\web\\dev\\database\\document 1.pdf");
#extract properties from pdf
my $title = $pdf->GetInfo('Title');
my $author = $pdf->GetInfo('Author');
my $keywords = $pdf->GetInfo('Keywords');
#insert values into database
$conn->Execute("INSERT INTO Properties(Title) values (?)",undef,($title));
$conn->Close();