jlongino has asked for the wisdom of the Perl Monks concerning the following question:

ODBC Connect with compression=gzip I have a Win98 box with an Access97 mdb file that I can connect to and query via dbiproxy. The dbiproxy command works fine like this: dbiproxy --localport 3333 --logfile "STDERR" but when I use the following: dbiproxy --localport 3333 --logfile "STDERR" --compression gzip and attempt to connect from the Solaris perl script:
#!/usr/local/bin/perl use DBI; my $dsn = "DBI:ODBC:HelpDesk"; my $proxy = "hostname=123.45.678.9;port=2222"; my $compression = "compression=gzip"; $dbh = DBI->connect("dbi:Proxy:$proxy;$compression;dsn=$dsn") or die "\ndbiproxy Connect Failed:\n" . " proxy:$proxy;\n dsn=$dsn\n $compression\n\n";
I get the following message on the Solaris:
DBI->connect(hostname=24.18.31.54;port=2222;compression=gzip; dsn=DBI:ODBC:HelpDesk) failed: Cannot log in to DBI::ProxyServer: Unexpected EOF from server at /usr/local/lib/perl5/site_perl/5.6.0/RPC/PlClient.pm line 83.
dbiproxy gives the following message:
Thu Jul 12 00:27:08 2001 err, Child died: Unexpected EOF from client at C:/Perl/site/lib/RPC/PlServer.pm line 149.
These code snippets are pretty much straight out of the O'Reilly book Programming the Perl DBI. I would greatly appreciate any help. I've spent more than 12 hours trying to get this to work. Thanks!

Replies are listed 'Best First'.
Re: ODBC Connect with compression=gzip
by LD2 (Curate) on Jul 12, 2001 at 12:59 UTC
    First off, you want to add use strict; to your code. I believe the reason why it's not working on Solaris is due to the missing username and password. Although Access doesn't have a username or password, you may have to pass along empty strings for it to work. Try using:
    $dbh = DBI->connect("dbi:Proxy:$proxy;$compression;dsn=$dsn", '', '')
    For the above question, turn on debugging:
    dbiproxy --localport 3333 --logfile "STDERR" --compression gzip --debugHopefully this will give you some helpful hints with the errors.
      Re: ODBC Connect with compression=gzip by LD2 First off, you want to add use strict; to your code. I believe the reason why it's not working on Solaris is due to the missing username and password. Although Access doesn't have a username or password, you may have to pass along empty strings for it to work. Try using: $dbh = DBI->connect("dbi:Proxy:$proxy;$compression;dsn=$dsn", '', '') For the above question, turn on debugging: dbiproxy --localport 3333 --logfile "STDERR" --compression gzip --debug Hopefully this will give you some helpful hints with the errors.
      Thanks for the --debug, use strict;, and username/password tips. I can see where they will be invaluable for future use. Actually I had been using the username/password empty strings during the course of my testing and since there was apparently no effect (as you mentioned) I left that out of the original snippet posted. I will include the empty strings from here on.

      Unfortunately, I still get the same basic messages on both sides. Thanks again for your input.
Re: ODBC Connect with compression=gzip
by pope (Friar) on Jul 12, 2001 at 13:07 UTC
    Make sure you run the same version of Storable on your Solaris box and on your Windows box. That "Unexpected EOF" message is typical of this problem.
      Re: ODBC Connect with compression=gzip by pope Make sure you run the same version of Storable on your Solaris box and on your Windows box. That "Unexpected EOF" message is typical of this problem.
      Thanks for the suggestion. Win32 is using Storable 1.0.10 and Solaris, 1.0.12

      I can't seem to be able to find a more current Win32 module using ppm or locate the 1.0.10 version to install on Solaris. I guess I'll try following the arcane instructions How do I make a PPM package? or install gcc on my Win98 box.

      Does anyone know of an simpler way to install/upgrade modules under Win32 ActivePerl?

      Thanks again for your help.
      Pope, I managed to track down a Solaris Storable module that is the same version as my Win98 box. It installed successfully on my Solaris box but I still get the same error messages. Any other ideas?
Re: ODBC Connect with compression=gzip
by jlongino (Parson) on Jul 13, 2001 at 03:54 UTC
    LD2 have you tried using $DBI::errstr? that may give you a more specific error

    LD2 I meant..have you used it for die.. i.e. or die $DBI::errstr; also..have you just tested your connect string.. to make sure it's accurate? (silly question, I know)
    The connect statement fails. There are no warnings or syntax errors (perl -wc). Here's the full statement:

    my $compression = "compression=gzip"; $dbh = DBI->connect("dbi:Proxy:$proxy;$compression;dsn=$dsn","","") or die"\n\n" . DBI->errstr() . "\n\n";

    The DBI->errstr() duplicates the already printed message:
    DBI->connect(hostname=192.245.224.9;port=3333;compression=gzip;dsn=DBI +:ODBC:Help Desk) failed: Cannot log in to DBI::ProxyServer: Unexpected EOF from server at /usr/local/lib/perl5/site_perl/5.6.1/RPC/PlClient.pm line 83. at odbc.p line 11 Cannot log in to DBI::ProxyServer: Unexpected EOF from server at /usr/local/lib/perl5/site_perl/5.6.1/RPC/PlClient.pm line 83.

    If I turn off compression in the dbiproxy script and leave compression=gzip in the connect statement, it executes without error.

    Thanks for your suggestions, it made me try a few extra things that were educational even if they didn't solve the problem.
Re: ODBC Connect with compression=gzip
by mattr (Curate) on Jul 12, 2001 at 11:41 UTC
    Have not seen this before. Did ODBC build and pass its tests properly? I don't see -compression in my man page, is this supported?
      Have not seen this before. Did ODBC build and pass its tests properly? I don't see -compression in my man page, is this supported? -- mattr
      All modules have been installed correctly and "make test"ed. Since I don't receive any error messages other than the ones listed in my first post, I assume that all necessary "use" statements are present.

      The compression is a feature of DBI::ProxyServer. If you don't have access to a copy of the O'Reilly Programming the Perl DBI:
      To speed things up, you could configure the proxy server to use on-the-fly compression (via the Compress::Zlib module) to clients querying the database over dial-up connection. . . . You can do this by running the dbiproxy script with the additional arguments of: --compression gzip

      . . . In order for your client to be able to send and receive compressed data from the DBI proxy server, you also must tell the proxy driver to use a compressed data stream. This is done by specifying the additional DSN key/value pair of compression=gzip when connecting to the database.

      . . . However, compression is a useful and transparent feature that can increase the efficiency of your networks and databases when using DBI proxying.