From: Erland Sommarskog on 29 Oct 2009 18:23 (dba.9999(a)gmail.com) writes: > In article <Xns9CB2AA23EFA6DYazorman(a)127.0.0.1>, Erland Sommarskog says... > > > OK I installed Win32::SQLServer > > my connection is failing: > > use Win32::SqlServer ; > my $server = 'OWNER_PC\SQLEXPRESS' ; > my $user = 'sa' ; > my $pw = '<MYPASSWORD>' ; > my $database = 'master' ; > my $provider = 'SQLNCLI10' ; > $sqlsrv = Win32::SqlServer->sql_init($server, $user, $pw, $database, > $provider); The error here is that sql_init is a global method, and it should be called as Win32::SqlServer::sql_init. Or just simply sql_init, as it exported by default. When you use -> instead, Win32::SqlServer will try to connect to the server Win32::SqlServer which of course will not succeed. (But I should probably make a change to permit this, to avoid that people fall into this trap.) -- Erland Sommarskog, SQL Server MVP, esquel(a)sommarskog.se Links for SQL Server Books Online: SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
First
|
Prev
|
Pages: 1 2 Prev: "Send Report to an Email Recipient" checkbox after SQL 2008 SP1 Next: Flag T4616 |