blackadder has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use warnings 'all'; use Win32; use Win32::ODBC; use Win32::NetAdmin; my $dsn = "SRV_DRV"; my $srv_tbl = "servers_tbl"; my $drives_tbl = "drives_tbl"; my $perms_db = new Win32::ODBC($dsn) || die "\nError=>\t$^E : $!\n"; print "\nError: $^E\n" if (! $perms_db); if ( $perms_db->Sql("SELECT * FROM $srv_tbl")){ print "Error!\n";} else{ my $srv = shift @ARGV || Win32::NodeName(); print "\nProcessing Server: '$srv'\n"; $perms_db->Sql ("INSERT INTO $srv_tbl (Server_Name) VALUES ('$srv' +)"); if (Win32::NetAdmin::GetServerDisks($srv, \ my @disks)) { print "\nAvailable logical drives\n"; foreach my $disk (@disks){ next if ($disk =~ /a|z/i ); $disk =~ s/:/\$/; print "Drive\t$disk\n"; if ( $perms_db->Sql("SELECT * FROM $drives_tbl")){ print "Error!\n"} else{ $perms_db->Sql ("INSERT INTO $drives_tbl (drive_letter) VALUES ('$disk +')"); } }} else{ print "\n\nError! $^E:$!.\n"; }} $perms_db->Close( );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Inserting values into MS Access sub tables
by LanceDeeply (Chaplain) on Jul 08, 2002 at 18:17 UTC | |
by blackadder (Hermit) on Jul 09, 2002 at 11:43 UTC | |
by blackadder (Hermit) on Jul 09, 2002 at 13:56 UTC | |
by blackadder (Hermit) on Jul 09, 2002 at 15:25 UTC | |
by LanceDeeply (Chaplain) on Jul 09, 2002 at 21:55 UTC | |
|
Re: Inserting values into MS Access sub tables
by sedhed (Scribe) on Jul 08, 2002 at 18:23 UTC |