Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Think about Loose Coupling
 
PerlMonks  

dbd::ODBC command strings

by s_m_b (Acolyte)
on Sep 16, 2005 at 08:01 UTC ( [id://492585]=perlquestion: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.

s_m_b has asked for the wisdom of the Perl Monks concerning the following question:

Most knowledgable monks....
Since I can't find a prebuilt dbd::ADO package for win32 (unless you know different), I'm using dbd::odbc, but I cannot find the correct command string for the dsn part, for mssql2000.
Anyone know?

Replies are listed 'Best First'.
Re: dbd::ODBC command strings
by etm117 (Pilgrim) on Sep 16, 2005 at 08:16 UTC
    from the DBD::ODBC docs right, in the line right above the 'Random Links' section:

    my $DSN = 'driver={SQL Server};Server=server_name;database=database_na +me;uid=user;pwd=password;'; my $dbh = DBI->connect("dbi:ODBC:$DSN") or die $DBI::errstr\n";

    Hope that helps,
    etm117

    UPDATE: If I recall correctly, the server_name needs to be the name of your ODBC connection defined on the machine you are running the code.

      found it -
      my $dbh = DBI->connect('DBI:ODBC:'.$dbname, $dblogin, $dbpass)

      was
      my $dbh = DBI->connect('DBI:ODBC:$dbname', $dblogin, $dbpass)

      forgotten to concatenate the dbi string !

Re: dbd::ODBC command strings
by VSarkiss (Monsignor) on Sep 16, 2005 at 10:25 UTC

    Well, I think you got your question about DBD::ODBC answered above, but I'm puzzled that you

    can't find a prebuilt dbd::ADO package for win32

    It's in the ActiveState PPM repository as well as many other places:

    H:\>ppm PPM - Programmer's Package Manager version 3.1. Copyright (c) 2001 ActiveState Corp. All Rights Reserved. ActiveState is a devision of Sophos. Entering interactive shell. Using Term::ReadLine::Stub as readline lib +rary. Type 'help' to get started. ppm> search DBD-ADO Searching in Active Repositories 1. DBD-ADO [2.94] A DBI driver for Microsoft ADO (Active Data +Objects) 2. DBD-ADO [2.7] ADO TypeInfo 3. DBD-ADO [2.72] A DBI driver for Microsoft ADO (Active Data +Objects) 4. DBD-ADO [2.73] A DBI driver for Microsoft ADO (Active Data +Objects) 5. DBD-ADO [2.81] A DBI driver for Microsoft ADO (Active Data +Objects) 6. DBD-ADO [2.82] A DBI driver for Microsoft ADO (Active Data +Objects) 7. DBD-ADO [2.89] A DBI driver for Microsoft ADO (Active Data +Objects) 8. DBD-ADO [2.90] A DBI driver for Microsoft ADO (Active Data +Objects) 9. DBD-ADO [2.91] A DBI driver for Microsoft ADO (Active Data +Objects) 10. DBD-ADO [2.92] A DBI driver for Microsoft ADO (Active Data +Objects) 11. DBD-ADO [2.93] A DBI driver for Microsoft ADO (Active Data +Objects) 12. DBD-ADO [2.94] A DBI driver for Microsoft ADO (Active Data +Objects) ppm> describe ==================== Package 1: Name: DBD-ADO Version: 2.94 Author: Steffen Goeldner (sgoeldner@cpan.org) Title: DBD-ADO Abstract: A DBI driver for Microsoft ADO (Active Data Objects) Location: ActiveState PPM2 Repository Available Platforms: 1. MSWin32-x86-multi-thread-5.8 ====================
    Maybe you need to set your ppm repositories? Take a look at some of the module installation Tutorials for help.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://492585]
Approved by lidden
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.