When using Win32::ODBC, what exactly is the DSN or "Data Source Name?"

I got this from the web:

***

Creating the ODBC data source:

An ODBC data source name(DSN) contains the connection information to access a database.

It can be created and configured via the ODBC Data Source Administrator:

* On machines running Microsoft Windows 2000 or Windows XP, create the ODBC data source by clicking:

Start->Settings->Control Panel->Administrative Tools->Data Sources->System DSN

Select the IBM ODBC Driver and choose a catalogued database (such as "SAMPLEDB")to be associated with the DSN.

***

That's all well and good, but won't work for me. What seems to work is when I use a database table name as the DSN. For instance, this is the logic that functions:

        my $database_handle_text =
        new Win32::ODBC("DSN=Contracts;UID=perl;PWD=saturn") or
        die Win32::ODBC::Error();

my $statement_text = "INSERT INTO Contracts (ContractTerms, Licensee, Licensor, Status, AgreementType, SIC, Source, ParentRefnum) VALUES (" . $submission_string_document . ")";

As you can see, I use the table Contracts as the DSN. The table Contracts is in the database Bob, but if I use Bob as the DSN, the logic fails. This is the code that fails:

        my $database_handle_text =
        new Win32::ODBC("DSN=Bob;UID=perl;PWD=saturn") or
        die Win32::ODBC::Error();

my $statement_text = "INSERT INTO Contracts (ContractTerms, Licensee, Licensor, Status, AgreementType, SIC, Source, ParentRefnum) VALUES (" . $submission_string_document . ")";

As I'm connecting to one SQL Server database on one server, shouldn't I be able to use the same connection string to access all the databases on that server for which I have permission?

-- Craig


---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0534-1, 08/23/2005
Tested on: 8/23/2005 3:41:54 PM
avast! - copyright (c) 1988-2004 ALWIL Software.
http://www.avast.com



_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to