NAME
DTS::Connection - a Perl class to represent a Microsoft SQL Server 2000 DTS Connection object
SYNOPSIS
use DTS::Application;
my $app = 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 $conns_ref = $package->get_connections;
foreach my $conn (@{$conns_ref}) {
print $conn->get_name, "\n";
}
# or if you have $connection as a regular
# MS SQL Server Connection object
my $conn2 = DTS::Connection->new($connection);
print $conn2->to_string, "\n";
DESCRIPTION
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 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 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 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 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, 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: DTS::Connection::FlatFile
and DTS::Connection::OLEBD
to enable polymorphic method calls.
SEE ALSO
DTS at
perldoc
.DTS::Application at
perldoc
.DTS::Package at
perldoc
.Win32::OLE at
perldoc
.MSDN on Microsoft website and MS SQL Server 2000 Books Online are a reference about using DTS' object hierarchy, but one will need to convert examples written in VBScript to Perl code.
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.