The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Win32::SqlServer::DTS::Connection - a Perl class to represent a Microsoft SQL Server 2000 DTS Connection object

SYNOPSIS

    use Win32::SqlServer::DTS::Application;

    my $app = Win32::SqlServer::DTS::Application->new(
        {
            server                 => $server,
            user                   => $user,
            password               => $password,
            use_trusted_connection => 0
        }
    );

    my $package = $app->get_db_package(
        { id => '', version_id => '', name => 'some_package', package_password => '' } );

    my $iterator = $package->get_connections();

    while ( my $conn = $iterator->() ) {

        print $conn->get_name(), "\n";

    }

    # or if you have $connection as a regular 
    # MS SQL Server Connection object

    my $conn2 = Win32::SqlServer::DTS::Connection->new($connection);
    print $conn2->to_string(), "\n";

DESCRIPTION

Win32::SqlServer::DTS::Connection class represent a DTS Connection object, serving as a layer to fetch properties from the DTS Connection stored in the _sibling attribute.

Although it's possible to create an Win32::SqlServer::DTS::Connection object directly (once a DTS Connection object is available), one will probably fetch connections from a package using the get_connections method from the Win32::SqlServer::DTS::Package module.

EXPORT

None by default.

METHODS

Inherints all methods from DTS superclass.

new

The only expected parameter to the new method is an already available DTS Connection object. Returns a Win32::SqlServer::DTS::Connection object.

get_type

Fetchs the provider value of the connection. It is an alias for the get_provider method.

to_string

Returns a string with all properties (but those returned by get_oledb method) from the a Win32::SqlServer::DTS::Connection object. Each property will have a short description before the value and will be separated by new line characters.

get_name

Fetchs the name of the connection.

get_description

Fetchs the description of the connection.

get_datasource

Fetchs the datasource value of the connection.

get_catalog

Fetchs the catalog value of the connection, if available.

get_id

Fetchs the connection ID. This ID is used as an connection reference by the tasks in a DTS package that needs a connection.

get_provider

Fetchs the provider name of the connection. Althought DTS Connection object support various types of connections, at this version, Win32::SqlServer::DTS::Connection will work only with DTSFlatFile and SQLOLEDB providers.

get_user

Fetchs the user used in the authentication of the connection.

get_password

Fetchs the password used in the authentication of the connection.

get_oledb

Returns an hash reference with all OLEDB properties used by the connection, being each key (a property) value a hash reference itself.

Being a property a hash reference, it contaings by default the following keys: name, value, property_id and property_set. These keys correspond to the properties Name, Value, PropertyID and PropertySet from the original property defined in the DTS API.

Only for the property FileType, that is a convertion from numeric code to the proper string.

CAVEATS

This class should be subclassed very soon to two new classes: Win32::SqlServer::DTS::Connection::FlatFile and Win32::SqlServer::DTS::Connection::OLEBD to enable polymorphic method calls.

SEE ALSO

CAVEATS

This API is incomplete. There are much more properties defined in the MS SQL Server 2000 DTS API.

AUTHOR

Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2006 by Alceu Rodrigues de Freitas Junior

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.