List Info

Thread: Re: Balasan: Re: perl can not do query: "use $database"?




Re: Balasan: Re: perl can not do query: "use $database"?
country flaguser name
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-Databaselistserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs

Balasan: Re: Balasan: Re: perl can not do query: "use $database"?
country flaguser name
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 <strorailways.dp.ua> wrote:
Patrix Diradja wrote:
>; Dear my friend, Charles.
&gt;
> 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:
&gt; my $dbh1 = DBI->connect("dbi:ADO:database=gua;host=127.0.0.1;port=1433",
> $uname, $pword)
&gt; || 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-Databaselistserv.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"?
country flaguser name
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

From: perl-win32-database-bounceslistserv.ActiveState.com [mailto:perl-win32-database-bounceslistserv.ActiveState.com] On Behalf Of Patrix Diradja
Sent: Thursday, February 08, 2007 7:45 AM
To: perl-win32-databaselistserv.ActiveState.com
Subject: Balasan: Re: Balasan: Re: perl can not do query: "use $database&quot;?

 

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&quot;;
my $uname=&quot;sa";
my $pword=&quot;penguin&quot;;
my $host=&quot;127.0.0.1";

print "I am dumping... bd4ln";;
foreach my $elemenbd4l(bd4l){
my $dsn = "Provider=SQLNCLI;"
  ; . "Server=$host;&quot;
&nbsp;  . "Database=$elemenbd4l;";;

my $dbh1 = DBI->;connect(&quot;dbi:ADO:database=gua;host=127.0.0.1;port=1433", $uname, $pword) or die $DBI::errstr

===

Serguei Trouchelle <strorailways.dp.ua> wrote:

Patrix Diradja wrote:
&gt; 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.
&gt;
> 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."
&gt;
> But why the connection is failed?

Try this:

my $dbh1 = DBI->;connect(&quot;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-Databaselistserv.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 )