This code is working but it only returns the first value that is queried into the database. How do I make it write all info it finds into the database?
Sub subWriteSoftwareInfo
set colItems = GetObject(strWinMgt).ExecQuery("select * from Win32_Product"
objRS.CursorType = iCursorType
objRS.LockType = iLockType
objRS.Source = "tblSoftware"
objRS.ActiveConnection = objCon
objRS.Open
for each objItem in colItems
objRS.AddNew
objRS("intCompID"
= intCompID
objRS("txtCaption"
= objItem.Caption
objRS("txtDescription"
= objItem.Description
objRS("txtName"
= objItem.Name
objRS("txtVendor"
= objItem.Vendor
objRS("txtVersion"
= objItem.Version
objRS.Update
next
objRS.Close
End Sub
Sub subWriteSoftwareInfo
set colItems = GetObject(strWinMgt).ExecQuery("select * from Win32_Product"
objRS.CursorType = iCursorType
objRS.LockType = iLockType
objRS.Source = "tblSoftware"
objRS.ActiveConnection = objCon
objRS.Open
for each objItem in colItems
objRS.AddNew
objRS("intCompID"
objRS("txtCaption"
objRS("txtDescription"
objRS("txtName"
objRS("txtVendor"
objRS("txtVersion"
objRS.Update
next
objRS.Close
End Sub