|
List Info
Thread: Re: Balasan: Re: perl can not do query: "use $database"?
|
|
| Re: Balasan: Re: perl can not do query:
"use $database"? |
  Ukraine |
2007-02-07 13:57:45 |
Patrix Diradja wrote:
> Dear my friend, Charles.
>
> I Use Perl on Windows Vista, MS SQL Server 2005, DBI,
ADO.
>
> I create 'myperl' as DSN from ODBC Administration
Tools.
>
> Here is my connection string:
> my $dbh1 =
DBI->connect("dbi:ADO:database=gua;host=127.0.0.1;po
rt=1433",
> $uname, $pword)
> || die "Could not open SQL connection."
>
> But why the connection is failed?
Try this:
my $dbh1 =
DBI->connect("dbi:ADO:database=gua;host=127.0.0.1;po
rt=1433",
$uname, $pword) or die $DBI::errstr;
--
Serguei Trouchelle
_______________________________________________
Perl-Win32-Database mailing list
Perl-Win32-Database listserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs
|
|
| Balasan: Re: Balasan: Re: perl can not
do query: "use $database"? |
  United States |
2007-02-08 09:44:38 |
|
Dear Serguei, I tried your thread but it does not work, the error message is: Can't locate DBI/ADO.pm in INC ( INC contains: C:Program FilesActiveState Perl Dev Kit 6.0lib C:/Perl/site/lib C:/Perl/lib .) at cldump.pl line 8. BEGIN failed--compilation aborted at cldump.pl line 8. Pleaseee.... teach me.... tell me where the mistake. ===hereis my code use strict; use DBI::ADO; use Win32::OLE; use Win32::OLE::Const 'Microsoft ActiveX Data Objects'; use warnings; #my $dsn="myperl"; my $uname="sa"; my $pword="penguin"; my $host="127.0.0.1";
print "I am dumping... bd4ln"; foreach my $elemenbd4l( bd4l){ my $dsn = "Provider=SQLNCLI;" . "Server=$host;" . "Database=$elemenbd4l;"; my $dbh1 = DBI->connect("dbi:ADO:database=gua;host=127.0.0.1;port=1433",
$uname, $pword) or die $DBI::errstr === Serguei Trouchelle <stro railways.dp.ua> wrote: Patrix Diradja wrote: > Dear my friend, Charles. > > I Use Perl on Windows Vista, MS SQL Server 2005, DBI, ADO. > > I create 'myperl' as DSN from ODBC Administration Tools. > > Here is my connection string: > my $dbh1 = DBI->connect("dbi:ADO:database=gua;host=127.0.0.1;port=1433", > $uname, $pword) > || die "Could not open SQL connection." > > But why the connection is failed?
Try this:
my $dbh1 = DBI->connect("dbi:ADO:database=gua;host=127.0.0.1;port=1433", $uname, $pword) or die $DBI::errstr;
-- Serguei Trouchelle _______________________________________________ Perl-Win32-Database mailing
list Perl-Win32-Database listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
;
Kunjungi halaman depan Yahoo! Indonesia yang baru!
|
| RE: Balasan: Re: Balasan: Re: perl can
not do query: "use $database"? |
  United States |
2007-02-08 13:20:18 |
|
Should this line:
use DBI::ADO;
really
be:
use DBI;
The error is telling you that DBI:ADO is not installed. You
should be using DBD::ADO, there is no such thing as DBI::ADO. Use PPM to be sure
you have DBD::ADO installed, then use DBI instead of DBI::ADO, and see if you
work.
Good luck,
Steve Howard
I tried your thread but it does not work, the error message
is:
Can't locate DBI/ADO.pm in INC ( INC contains: C:Program
FilesActiveState Perl Dev Kit 6.0lib C:/Perl/site/lib C:/Perl/lib .) at
cldump.pl line 8.
BEGIN failed--compilation aborted at cldump.pl line 8.
Pleaseee.... teach me.... tell me where the mistake.
use strict;
use DBI::ADO;
use Win32::OLE;
use Win32::OLE::Const 'Microsoft ActiveX Data Objects';
use warnings;
#my $dsn="myperl";
my $uname="sa";
my $pword="penguin";
my $host="127.0.0.1";
print "I am dumping... bd4ln";
foreach my $elemenbd4l( bd4l){
my $dsn = "Provider=SQLNCLI;"
. "Server=$host;"
. "Database=$elemenbd4l;";
my $dbh1 =
DBI->connect("dbi:ADO:database=gua;host=127.0.0.1;port=1433",
$uname, $pword) or die $DBI::errstr
===
Serguei Trouchelle <stro railways.dp.ua> wrote:
Patrix Diradja wrote:
> Dear my friend, Charles.
>
> I Use Perl on Windows Vista, MS SQL Server 2005, DBI, ADO.
>
> I create 'myperl' as DSN from ODBC Administration Tools.
>
> Here is my connection string:
> my $dbh1 = DBI->connect("dbi:ADO:database=gua;host=127.0.0.1;port=1433",
> $uname, $pword)
> || die "Could not open SQL connection."
>
> But why the connection is failed?
Try this:
my $dbh1 =
DBI->connect("dbi:ADO:database=gua;host=127.0.0.1;port=1433",
$uname, $pword) or die $DBI::errstr;
--
Serguei Trouchelle
_______________________________________________
Perl-Win32-Database mailing list
Perl-Win32-Database listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Kunjungi
halaman depan Yahoo!
Indonesia yang baru!
|
[1-3]
|
|
|
about | contact Other archives ( Real Estate discussion Medical topics )
|