Hello monks!!
I'm in fix! I have a sub called findodbc. I pass to it an IP
I want to build an hash where keyes are the paths in the Data Base Qualifier {DBQ} and where the values are the DSN.
When I manually use regedit->conect remote registry I 'm able to view ODBC/ODBC.INI and all remote sistem DSN.
When I launch the same code locally it's all ok.
BUT when my sub run from remote I can view only
ODBC Data Sources/ and ODBC File DSN/ that are useless.
I have tried to connect to the remote machine too and to call the script "locally" and read out the data with some results.
use Win32::TieRegistry ( Delimiter=>"/" );
[...]
sub findodbc
{
$lista= $Registry->Connect( "$ip", "LMachine" )or die "Can't connect
+to HostA's HKEY_LOCAL_MACHINE key: $^E\n";
$lista=$Registry->{"HKEY_LOCAL_MACHINE/Software/ODBC/ODBC.INI"}or di
+e "$^E\n";
foreach $nom(keys (%$lista))
{
print $nom;
chop $nom;
$coso= $Registry->{"HKEY_LOCAL_MACHINE/Software/ODBC/ODBC.INI/$nom"}
+or die "$^E\n";
print "\n$nom\t".$coso->{DBQ}or die $!;
if (defined $coso->{DBQ})
{
if($coso->{DBQ}=~/\\([\w -]+\\)(database\\)(\w+\.mdb)/){$odbc{$1.$3
+}=$nom}
}
while (($k, $v)=each(%odbc)){print "$k--------$v\n"}
}
exit;
}
greetings from sunny but cold roma
lor*
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.