srikantvm has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use Win32::OLE; use Win32::OLE::Const 'Microsoft ActiveX Data Objects'; # Change these three variables my $database = "TestAccess.mdb"; my $table = "Clients"; my $field1 = "CompanyName"; my $field2 = "ClientID"; my $field3 = "Phone"; my $Conn = Win32::OLE->new("ADODB.Connection"); my $RS = Win32::OLE->new("ADODB.Recordset"); my $DSN = "PROVIDER=MSDASQL;DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$database;UID=;PWD=;"; $Conn->Open($DSN); my $SQL = "SELECT $field1, $field2, $field3 FROM $table"; $RS->Open($SQL, $Conn, 1, 1); until ($RS->EOF) { my $value1 = $RS->Fields($field1)->value; my $value2 = $RS->Fields($field2)->value; my $value3 = $RS->Fields($field3)->value; print $value1,"\t",$value2,"\t",$value3,"\n"; $RS->MoveNext; } $RS->Close; $Conn->Close;
Hi All,
Please go through the above code, If i execute the same code with tables and columns having whitespace characters in their names. I am getting the following error (Can't call method "value" on an undefined value). Please help.... Kindly suggest me the solution for this particular scenario.
Thanks & Regards,
Srikant
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: error returned in Win32::OLE module with mdb file's tables and cloumns having whitespace characters in their names.
by strat (Canon) on Apr 09, 2008 at 07:53 UTC | |
Re: error returned in Win32::OLE module with mdb file's tables and cloumns having whitespace characters in their names.
by apl (Monsignor) on Apr 08, 2008 at 11:36 UTC | |
Re: error returned in Win32::OLE module with mdb file's tables and cloumns having whitespace characters in their names.
by thundergnat (Deacon) on Apr 08, 2008 at 15:38 UTC |
Back to
Seekers of Perl Wisdom