Skip to content

Instantly share code, notes, and snippets.

@hexfusion
Created November 5, 2013 14:36
Show Gist options
  • Save hexfusion/7319937 to your computer and use it in GitHub Desktop.
Save hexfusion/7319937 to your computer and use it in GitHub Desktop.
QODBC-connection.pl
!/usr/local/bin/perl
use strict;
use warnings;
use DBI;
use Crypt::IDEA
my $key= 'mykey';
my $host = "remote.mydomain.com";
my $port = "myport";
my $db = "DBI:ODBC:QBPOS";
my $user ='domain\username';
my $passwd="mypass";
my $dbh = DBI->connect("dbi:Proxy:cipher=IDEA;key=$key;hostname=$host;port=$port;dsn=$db",
undef, undef, {PrintError => 0, RaiseError =>0});
if (!$dbh)
{
print "$DBI::err\n$DBI::errstr\n$DBI::state";
}
else
{
print "Database connected correctly\n";
$dbh->disconnect if ($dbh);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment