Page 2 of 2 <12
Topic Options
#85757 - 2002-05-25 04:20 AM Re: More COM issues with 4.10 rc1
Shawn Administrator Offline
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 [Wink] 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 Offline
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

_________________________
Home page: http://www.kixhelp.com/hb/

Top
#85759 - 2002-05-25 04:30 AM Re: More COM issues with 4.10 rc1
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Check out the manual that came with RC1 - under the section called:

Miscellaneous enhancements

-Shawn

Top
#85760 - 2002-05-25 04:43 AM Re: More COM issues with 4.10 rc1
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
This script should dump the db you created in your script:

break on

$db = "f:\msaccess\db1.mdb"

$cn = createobject("adodb.connection")

$cn.connectionstring = "data source=$db; provider=microsoft.jet.oledb.4.0;persist security info=false"

$cn.open()

$rs = $cn.execute('select * from inventory')

while not $rs.eof()

  ? $rs.fields("date") ":" $rs.fields("time") "-" $rs.fields("computername") " " $rs.fields("program")

 $rs.movenext

loop

$cn.close()
$cn = 0

exit 1



So it was in the manual - but wasn't documented in the new features text file that ships with the distribution (kix2001.txt) - heheh - serves me right for not reading the manual - Les is going to kick my a$$ !

-Shawn

[ 25 May 2002, 04:44: Message edited by: Shawn ]

Top
#85761 - 2002-05-25 04:47 AM Re: More COM issues with 4.10 rc1
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
And it does without the ".Value" property being specified. [Cool]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#85762 - 2002-05-25 04:49 AM Re: More COM issues with 4.10 rc1
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
But like you pointed out - writing to the default property didn't work, right ?
Top
#85763 - 2002-05-25 04:51 AM Re: More COM issues with 4.10 rc1
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Is "Value" the default property of "$rs.fields.item("date").value = @DATE"?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#85764 - 2002-05-25 04:52 AM Re: More COM issues with 4.10 rc1
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Thats my guess. Yeah it is - i just checked MSDN.

[ 25 May 2002, 04:59: Message edited by: Shawn ]

Top
Page 2 of 2 <12


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 874 anonymous users online.
Newest Members
StuTheCoder, M_Moore, BeeEm, min_seow, Audio
17884 Registered Users

Generated in 0.032 seconds in which 0.014 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org