I am using the Win32::ODBC module, and I continually get the following
error message:
 
  Can't locate auto/Win32/ODBC/GetTypeInfo.al in @INC (@INC contains:
C:/Perl/site/lib C:/Perl/lib .) at odbcinfo.pl line 58

Indeed, there is no "filename.al" file of any kind on my disk anywhere,
which leads me to believe the problem is elsewhere.

I'm just getting started (with much difficulty), so I'm running some
sample code that I downloaded, shown below (I have marked line 58). I
would appreciate any ideas on what the problem is. I am using Active
Perl 5.8.8 and I also use the ActiveState Perl Dev Kit which I've only
begun to explore.

=== sample code that causes the error ===

use warnings;
Use strict;
use Win32::ODBC;

init_vars();

$db = new Win32::ODBC($DSNstr)
    or die "Error: Could not connect to \"$DSN\".\n" .
Win32::ODBC::Error() . "\n";

$~ = "REPORT";
foreach $Attrib (sort(keys(%Attributes))) {
  $Desc = $Attributes{$Attrib} -> {Desc};
  $Function = $Attributes{$Attrib} -> {Function};
  $Value = eval("\$db->$Function(\$db->$Attributes{$Attrib}->{Value})");
  print "\n$Attrib  [$Attributes{$Attrib}->{Value}] = \"$Value\"\n";
  print "   $Desc.\n";

  foreach $type (sort(keys(%{$Attributes{$Attrib}})))
  {
    if ($type eq "Desc" || $type eq "Value" || $type eq "Function")
{next;}

    undef $Const;
    undef $Supported;

    $Const = eval("\$db->$Attributes{$Attrib}->{$type}");
    $Supported = ($Value & $Const);
    if( $Supported > 0 )
    {
      $Supported = "Yes";
    }
    else
    {
      $Supported = "No";
    }
    write();
  }
}

print<<EOText;


Show how this ODBC Driver maps SQL Data Types:
----------------------------------------------
    The following table shows how this ODBC driver will map common
    SQL Data Types to it's ODBC Driver specific data type.
    it will also show the literal syntax, that is, how you deal with
    the data in an SQL statement. For example, if the literal syntax
    for the data type CHAR is 'DATA' then you would surround your
    CHAR data with single quotes as in :
        SELECT * FROM FOO WHERE Field1 = 'jello'

EOText

$~ = "Type_Header";
write();
$~ = "Type_Info";
foreach $type ( ( @types ) )   ### THE EVIL LINE 58 ###
{
  if( $db->GetTypeInfo( eval( "\$db->SQL_$Type" ) ) )
  {
    undef %Data;
    if( $db->FetchRow() )
    {
      %Data = $db->DataHash();
      $Data{data_example} = $Data{LITERAL_PREFIX} . "DATA" .
$Data{LITERAL_SUFFIX};
    }
    else
    {
      $Data{TYPE_NAME} = "---not supported---";
    }
    write();
  }
}

print "\n--== End Of Report ==--\n";
$db->Close();

#--------------------------------------
sub init_vars
{
  $db = '';
  %DSNs = ();
  $DSN = 'Vantage8';
  $UID = 'odbcuser';
  $PWD = 'odbcuser';
  $DSNstr = "DSN=$DSN; UID=$UID; PWD=$PWD";
  $driverType = 'DataDirect 4.20 32-Bit Progress SQL92 v10.08';

  @types = qw
  (
    BIGINT
    BINARY
    BIT
    CHAR
    DATE
    DECIMAL
    DOUBLE
    FLOAT
    INTEGER
    LONGVARBINARY
    LONGVARCHAR
    NUMERIC
    REAL
    SMALLINT
    TIME
    TIMESTAMP
    TINYINT
    VARBINARY
    VARCHAR
  );

  %Attributes =
  (
      "Position" =>
      {
        Desc => "Postioned operations",
        Value    =>  'SQL_POS_OPERATIONS',
        Function =>  GetInfo,
        Position => 'SQL_POS_POSITION',
        Refresh  =>  'SQL_POS_REFRESH',
        Update   =>  'SQL_POS_UPDATE',
        Delete   =>  'SQL_POS_DELETE',
        Add      =>  'SQL_POS_ADD'
      },
      "Position Statements" => {
          Desc     =>  "Positioned Statements",
          Value    =>  'SQL_POSITIONED_STATEMENTS',
          Function =>  GetInfo,
          Delete   =>  'SQL_PS_POSITIONED_DELETE',
          Update   =>  'SQL_PS_POSITIONED_UPDATE',
          "Select Update" => 'SQL_PS_SELECT_FOR_UPDATE'
          },

  ...additional code deleted for clarity...
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to