On this point, how about trying DBD::ODBC?
Oops! Sorry. The important point I intended to make in my original post (but didn't) is that I did, indeed, try DBD::ODBC first and discovered it doesn't work with the SearchServer 5.3 ODBC driver. Apparently, SearchServer only supports ODBC 1.0. Crazy, huh?
Here's a little test script that demonstrates the issue (I think):
C:\>nl -ba -w 2 -s " " dbd-odbc.pl
1 #!C:/Perl/bin/perl.exe
2
3 use strict;
4 use warnings;
5 use DBI;
6
7 @ARGV == 2 or die "Usage: perl $0 <DSN> <ODBC Version>\n";
8
9 my $dsn = shift;
10 my $ver = shift;
11
12 my $dbh = DBI->connect("dbi:ODBC:$dsn", undef, undef, {
13 PrintError => 0,
14 RaiseError => 1,
15 odbc_version => $ver,
16 });
17
18 $dbh->disconnect;
19
20 exit 0;
21
22 __END__
C:\>db -d TESTDSN "SELECT COUNT(*) FROM TABLES"
COUNT(*)
445
C:\>perl dbd-odbc.pl TESTDSN 1
DBI connect('TESTDSN','',...) failed: [Microsoft][ODBC Driver Manager]
+ Invalid argument value (SQL-HY024)(DBD: db_login/SQLSetEnvAttr err=-
+1) at dbd-odbc.pl line 12
C:\>perl dbd-odbc.pl TESTDSN 2
DBI connect('TESTDSN','',...) failed: [Hummingbird][SearchServer]Drive
+r not capable (SQL-S1C00)(DBD: dbd_db_login/SQLSetConnectOption err=-
+1) at dbd-odbc.pl line 12
C:\>perl dbd-odbc.pl TESTDSN 3
DBI connect('TESTDSN','',...) failed: [Hummingbird][SearchServer]Drive
+r not capable (SQL-HYC00)(DBD: dbd_db_login/SQLSetConnectOption err=-
+1) at dbd-odbc.pl line 12
C:\>
(The
nl and
db commands are handy
MKS Toolkit utilities.)
This was the motive for my inquiry. I'm wondering if anyone has used Perl with SearchServer and, in particular, managed to access SearchServer tables via ODBC using either Win32::ODBC or DBD::ODBC.
Jim
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.