Balasan: RE: Balasan: RE: Balasan: RE: can't execute "use $database"
- From: patrixdiradja@xxxxxxxxxxx (Patrix Diradja)
- Date: Thu, 8 Feb 2007 22:53:57 +0700 (ICT)
Dear Garrett.... it still doesn't work.
Here is the error message:
Can't locate DBI/ADO.pm in @INC (@INC contains: C:\Program Files\ActiveState Perl Dev Kit 6.0\lib\ C:/Perl/site/lib C:/Perl/lib .) at cldump.pl line 8.
BEGIN failed--compilation aborted at cldump.pl line 8.
Please tell me furthermore.
here is my code:
#####
use strict;
use DBI::ADO;
use Win32::OLE;
use Win32::OLE::Const 'Microsoft ActiveX Data Objects';
use warnings;
my $uname="sa";
my $pword="penguin";
my $host="127.0.0.1";
my @bd4l=("FinanCore");
#if (@ARGV){
#my @bd4l=@ARGV;
#}else{
#my @bd4l=("AprovaApp1");
#}
print "I am dumping... @bd4l\n";
foreach my $elemenbd4l(@bd4l){
my $dsn = "Provider=SQLNCLI;"
. "Server=$host;"
. "Database=$elemenbd4l;";
my $dbh1 = DBI->connect("dbi:ADO:$dsn", $uname, $pword) or die $DBI::errstr;
####
"Garrett, Philip (MAN-Corporate)" <Philip.Garrett@xxxxxxxxxxx> wrote:
Patrix Diradja wrote:
Yeah, that's the problem Garrett.
I usually use that way to connect to ms msql.
But now, I want that my perl code can work with several databases.
So I need somewhat like the Connection String which I can modify
(forming string) and than just does "$dbh->connect(<> for me>>)". and does "$dbh->close" before doing again connect to
another database ($dbh->connect).
Ok, try this: (found on www.connectionstrings.com)
my $connstr = "Provider=SQLNCLI;"
.. "Server=$server;"
.. "Database=$database;";
my $dbh = DBI->connect("dbi:ADO:$connstr",$user,$pass)
|| die $DBI::errstr;
If you are using SQL Server 2005 Express, you'll need to add \EXPRESS
after the server name like this:
"Server=$server\\EXPRESS;"
Philip
---------------------------------
Kunjungi halaman depan Yahoo! Indonesia yang baru!
- Follow-Ups:
- RE: Balasan: RE: Balasan: RE: Balasan: RE: can't execute "use $database"
- From: Philip Garrett
- RE: Balasan: RE: Balasan: RE: Balasan: RE: can't execute "use $database"
- References:
- RE: Balasan: RE: Balasan: RE: can't execute "use $database"
- From: Philip Garrett
- RE: Balasan: RE: Balasan: RE: can't execute "use $database"
- Prev by Date: RE: perl DBD and DBI for 64 bit perl
- Next by Date: RE: :Oracle on Solaris 10 and Oracle 10g
- Previous by thread: RE: Balasan: RE: Balasan: RE: can't execute "use $database"
- Next by thread: RE: Balasan: RE: Balasan: RE: Balasan: RE: can't execute "use $database"
- Index(es):
Relevant Pages
|