File: driver_complete.pl

package info (click to toggle)
libdbd-odbc-perl 1.50-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,392 kB
  • ctags: 496
  • sloc: perl: 8,818; ansic: 6,376; makefile: 33; sql: 8
file content (18 lines) | stat: -rw-r--r-- 619 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# $Id$
# shows how (in Windows) you can set the odbc_driver_complete flag,
# pass incomplete connection strings and be prompted for completion
use strict;
use warnings;
use DBI;

my $h = DBI->connect('dbi:ODBC:DRIVER={SQL Server}', undef, undef, {odbc_driver_complete => 1}) or die $DBI::errstr;
if (defined($h->err)) {
    if ($h->err eq 0) {
	print "Warning message : ", $h->errstr, "\n";
    } elsif ($h->err eq '') {
	print "Informational message : ", $h->errstr, "\n";
    }
}
print "Out Connection String: ", $h->{odbc_out_connect_string}, "\n";
print "odbc_driver_complete: ", $h->{odbc_driver_complete}, "\n";