#85757 - 2002-05-25 04:20 AM
Re: More COM issues with 4.10 rc1
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
it should have worked. can you change your script to display the fields to the console, but not use the VALUE property, just try the default. maybe i'm just blowing hot air here im pretty sure i read this about this new feature somewhere - damn if i can remember where though !!!
-Shawn [ 25 May 2002, 04:25: Message edited by: Shawn ]
|
|
Top
|
|
|
|
#85758 - 2002-05-25 04:28 AM
Re: More COM issues with 4.10 rc1
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
I am not quite sure how to do that since it is building a record. The code is posted below in case you want to modify it. Just change the MDB file name and create a table called inventory with the four fields: quote: "computername" "program" "date" "time"
code:
$DBpath = "c:\data\users\default\db1.mdb" $CNstring = "provider=microsoft.jet.oledb.4.0;data source=$DBpath;persist security info=false" $CMDtxt = "select * from Inventory" $cn = CreateObject ("ADODB.Connection") $cmd = CreateObject ("ADODB.Command") $rs = CreateObject ("ADODB.RecordSet") $cn.connectionstring = $CNstring $cn.Open $cmd.activeconnection = $cn $rs.cursortype = 3 $rs.locktype = 3 $rs.activecommand = $cmd $cmd.commandtext = $CMDtxt $rs.Open ($cmd)
Function GetUninstallInfo() Dim $Index, $Key, $RC, $Value, $RootKey Dim $progs[0] $Index = 0 $RootKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" $Key = EnumKey($RootKey, $Index) While @Error = 0 ReDim PRESERVE $progs[$Index] $RC = EnumValue($RootKey + $Key, 1) If @Error = 0 $Value = ReadValue($RootKey + $Key, "DisplayName") If $Value = "" $Value = ReadValue($RootKey + $Key, "QuietDisplayName") If $Value = "" $Value = $Key EndIf EndIf Else $Value = $Key EndIf $progs[$Index] = $Value $Index = $Index + 1 $Key = EnumKey($RootKey, $Index) Loop $GetUninstallInfo = $progs EndFunction $array = GetUninstallInfo() $i=0 For Each $item in $array $rs.addnew $rs.fields.item("computername") = @WKSTA $rs.fields.item("program") = $item $rs.fields.item("date").value = @DATE $rs.fields.item("time").value = @TIME $rs.update
? "$i: $item" $i = $i +1 Next $rs.Close Return :END
|
|
Top
|
|
|
|
#85761 - 2002-05-25 04:47 AM
Re: More COM issues with 4.10 rc1
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
And it does without the ".Value" property being specified.
|
|
Top
|
|
|
|
#85763 - 2002-05-25 04:51 AM
Re: More COM issues with 4.10 rc1
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Is "Value" the default property of "$rs.fields.item("date").value = @DATE"?
|
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 874 anonymous users online.
|
|
|