#!/usr/bin/perl #$Id: tkdm,v 1.23 2008-01-21 08:47:34 kiesling Exp $ $VERSION='0.21'; @EXPORT_OK=(qw/$VERSION/); use Tk; use Tk::widgets qw(Dialog Canvas Font Balloon Table TextUndo CmdLine); use Carp; use Getopt::Long; use UnixODBC qw(:all); use UnixODBC::BridgeServer; use RPC::PlClient; use POSIX; my $loginsfile = $ENV{HOME}.'/.odbclogins'; my $serverpidfile = '/usr/local/var/odbcbridge/odbcbridge.pid'; my %peers; # Hash of host keys and value of login data from $loginsfile. my %hostdsns; # Hash of host keys with list of dsns for value. my $peerport = 9999; if (! -f $loginsfile) { print STDERR "\nCould not open login information file $loginsfile.\n"; print STDERR "Refer to tkdm(1) (\"man tkdm\") for information.\n"; exit 255 } if (! -f $serverpidfile) { print STDERR "\nThe UnixODBC remote server daemon, odbcbridge, seems not to\n"; print STDERR "be running. Make sure that it is installed correctly,\n"; print STDERR "and refer to the odbcbridge man page (\"man odbcbridge\")\n"; print STDERR "for information about how to configure and start the \n"; print STDERR "bridge server.\n"; exit 255; } ## ## Connection Status - ## my $HOST_NOT_CONNECTED = 'Not connected'; my $HOST_CONNECTED = 'Connected'; my $DSN_OPEN = 'Open DSN'; my $CLIENT_LOGIN_ERROR = 'Client login error.'; my $dsnloginusername = ''; my $dsnloginpassword = ''; # Text of SQL query entered by user. my $userquerytext = 'Enter your SQL query here.'; my @hostlabels; # Refs of dsnlabel hashes. my %tablepanetags; # Canvas Ids and subwidget tags of table pane # hashes. my $imagepadding = 3; # Pixels of padding around images. my $host_indent = 5; my $dsn_indent = 10; my $table_indent = 15; my $helptext =< Set the window background color. --debug Print debugging messages. --displayfont Font used in labels. --height Window height. --help Print this message and exit. --monofont Monospaced font for columnar results. --relief