Leser: 23
1 2 3 4 5 6 7
my $dsn = "Datenbank"; my $dbh = Win32::ODBC->new("DSN=$DSN"); # zu Datenbank verbinden my $sql = "SELECT * FROM Tabellenname"; # deine SQL-Abfrage if($db->Sql($sql_string)) { # Abfrage war erfolgreich # dein weiterer Programmcode } $db->Close(); # Verbindung zu Datenbank schließen
DoCmd.TransferText acImportDelim, "Name der Importspezifikation", "Name der Tabelle", ""
1
2
3
4
5
6
7
8
9
10
11
use strict;
use warnings;
use Win32::OLE;
my $access;
my $datei = "D:\\TEST\test.accdb";
$access = Win32::OLE->GetActiveObject('Access.Application');
$access->OpenCurrentDatabase($datei);
$access->{DoCmd}->RunMacro("Import");
$access = Win32::OLE->new('Access.Application');
$access = Win32::OLE->GetActiveObject('Access.Application');
Quote$access->{ActivePrinter} = "FreePDF XP";
$access->{DoCmd}->OpenQuery("Abfrage_1");
$access->{DoCmd}->Printout;
1 2 3 4 5
$access->{DoCmd}->Printout( { ActivePrinter => "FreePDF XP", }, ) or die Win32::OLE->LastError();
Win32::OLE(0.1709) error 0x80020006: "Unbekannter Name" "ActivePrinter" in GetIDsOfNames for "Printout" at C:\Data\user\Desktop\druck.pl line 12.