Use this code to determine if you have any error when writing to Access. Change the properties of your DOS window and increase the "Screen Buffer Size" "Height" to 2000 lines. This will permit you to see all of the output.
code:
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


$DBpath = "\\fdadmfs1\inventory$$\swinv.mdb"
If Exist("$DBpath") = 0 ? "Database Not Found. Aborting..."
Sleep 3
Goto end
EndIf


$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)

$array = GetUninstallInfo()

$i=0
For Each $item in $array
? ? "$i: $item"
$rs.addnew
? "Addnew: @error @serror"
$rs.fields.item("computername").value = @WKSTA
? "computername: @error @serror"
$rs.fields.item("program").value = $item
? "program: @error @serror"
$rs.fields.item("date").value = @DATE
? "date: @error @serror"
$rs.fields.item("time").value = @TIME
? "time: @error @serror"
$rs.update
? "Update: @error @serror"

$i = $i +1
Next

$rs.Close

:END



[ 24 May 2002, 17:45: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/