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

Ive been scanning the material on here and other places, but I just can't seem to get enough information on how to get set up to connect to sql server 7. I would prefer the easiest way possible, performance isn't really a concern here. I need to know what modules to install and how to get their variables set up. I could also use some sample code showing connection strings. I am using sql server 7 and red hat linux. I don't have alot of perl wisdon yet, so thanks for your patience. Steve
  • Comment on Need help getting environment set up to connect to SQL server

Replies are listed 'Best First'.
Re: Need help getting environment set u to connect to SQL server
by Aristotle (Chancellor) on May 21, 2002 at 22:44 UTC
    Do you know about DBI yet?

    Makeshifts last the longest.

      Unfortunately Screamer it's a bit more complicated than that. *nix systems do not have a native way to speak TDS (without help from FreeTDS), this is the protocol for Sybase and MS SQLServer. The DBD::Sybase module will talk to older versions of MS SQLServer but more recent versions have deviated from the DBD::Sybase module's version of TDS.

      But anyways, this question has been answered as a Q&A and also here.

      Anonymous Monk, you can find answers to questions that have been asked before by using the search (available in the bar up top). This will wind up getting you your answer a lot quicker than making a post.



      grep
      These are not the monks you are looking for, move along
      yes, I have connected using DBI from active state, using a DSN that I set up through windows.
        Then I am not sure as to what your question is. If you know how to and successfully have connected to the database - what is the "help getting environment set up" you need?

        Makeshifts last the longest.

Re: Need help getting environment set up to connect to SQL server
by strat (Canon) on May 22, 2002 at 11:16 UTC
    If you talk about MsSql7-Server (a lot of Databases are Sql-Servers), you could easily connect with ODBC. Either use Win32::ODBC (I like it, because it allows good interaction with the Win32-ODBC-Manager; but is not such a general interface as DBI, and is restricted to Win32-Plattforms), or use DBI and DBD::ODBC.

    The DBD::Sybase Module already mentioned is very good, too.

    Best regards,
    perl -le "s==*F=e=>y~\*martinF~stronat~=>s~[^\w]~~g=>chop,print"

Re: Need help getting environment set u to connect to SQL server
by Anonymous Monk on May 21, 2002 at 22:26 UTC
    ps. I also can't get in to freetds.org to see the user manual. Do I need to do something to not get the Forbidden messgage? Thanks
      Well this is a rough example since you were not real specific as to what you needed but here goes

      #!/usr/bin/perl -w use DBI; #The database handle my $dbh = DBI->connect( "dbi:SQL:Example", "username", "password" , { RaiseError => 1 });