Windows Perl Scripting Forums » General

Win32::ODBC

(2 posts)
  • Started 12 years ago by UNKILBEEG
  • Latest reply from keithh

  1. UNKILBEEG
    Member

    Is the Win32::ODBC package still available? I tried to install it via the ActiveState PPM script and the installation bombed.

    I downloaded the most recent version I could find from the ftp site, ftp://ftp.roth.net/pub/ntperl, but even that is quite old. My version of Active State is Build 817, and the only documentation I found for installing Win32::ODBC assumed a build of approximately 300.

    I've played with the install and have had some luck getting it installed, but should I trust it with a Perl version so drastically different than the one it was apparently built for?
    Posted 12 years ago #
  2. keithh
    Member

    I've used the Win32::ODBC in the past with no issues. But now I use ADO via the Win32 OLE

    Ive added some snippets below to give the general idea. It works really well for me.
    e.g.

    use Win32::OLE;
    use Win32::OLE::Const 'Microsoft ActiveX Data Objects';
    use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
    use MIME::Lite;
    use Net::SMTP;
    use File::Copy;
    use File::Path;

    #my $ConnStr="Provider=SQLNCLI.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DEDS;Data Source=dambuster" ;


    ########

    Some code to pull from a database

    my $Statement = "SELECT * FROM FTP_Pull_list WHERE Active ='1'";
    my $RS;
    if(! ($RS = $Conn->Execute($Statement)))
    {
    #print Win32::OLE->LastError() ;
    errorlog("Database Execute Error", Win32::OLE->LastError(),3, __LINE__);
    exit;;
    }
    while (! $RS->EOF)
    {
    $pull_list_name{$RS->Fields("Name")->value}=$RS->Fields("email")->value;
    $pull_list_ftp_server{$RS->Fields("Name")->value}=$RS->Fields("FTP_Server")->value;
    $pull_list_password{$RS->Fields("Name")->value}= $RS->Fields("password")->value;
    $pull_list_userid{$RS->Fields("Name")->value} = $RS->Fields("Userid")->value;
    $pull_list_directory{$RS->Fields("Name")->value}=$RS->Fields("directory")->value;
    $files_sendto{$RS->Fields("Name")->value}=$RS->Fields("sendto")->value;
    $files_ext{$RS->Fields("Name")->value}=$RS->Fields("ext_to_get")->value;
    $zipname{$RS->Fields("Name")->value}=$RS->Fields("zip_name")->value;

    $RS->MoveNext;
    }
    $RS->Close;
    $Conn->Close;
    }
    Posted 12 years ago #

RSS feed for this topic

Reply

You must log in to post.