Hi, I am using the below code and i am getting error. How to solve this? i cannot understand this error also.
DBD::DBM::st execute failed: Cannot open .\Reference.lck: No such fil +e or directory at C:/Perl/lib/DBD/File.pm line 574. [for Statement " Select * from Reference"] at DataBaseControl.pl line 22. DBD::DBM::st execute failed: Cannot open .\Reference.lck: No such fil +e or directory at C:/Perl/lib/DBD/File.pm line 574. [for Statement " Select * from Reference"] at DataBaseControl.pl line 22.
use strict; use warnings; use DBI; my ($dbh, $sth); my $Error_Message = "\nThere Was A Problem Connecting To The Database\ +n"; my $driver = 'DBM'; # e.g., mysql or ODBC or ??? my $dbusername = 'sa'; my $dbpassword = 'admin'; my $server = 'localhost'; my $database = 'Copyediting'; $dbh = DBI->connect("dbi:$driver:$database:$server", $dbusername, $dbp +assword, {'RaiseError' => 1, 'PrintError' => 1} ) || die "$Error_Message $DBI::errstr"; $dbh->{RaiseError} = 1; for my $sql( split /;\n+/," Select * from Reference; "){ my $sth = $dbh->prepare($sql); $sth->execute; $sth->dump_results if $sth->{NUM_OF_FIELDS}; } $dbh->disconnect();
Also i don't what driver needs to specify here? I have the below driver in my system using this code.
@driver_names = DBI->available_drivers;
DBM ExampleP File ODBC Proxy SQLite Sponge mysql
In reply to sql server database connectivity error by Selvakumar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |