I am learning how to get records from a database. I was able to accomplish
but I know there are 6 records and I only display 1. I know what to do but
do not know how in vbscript. i think the script needs a for loop to display
records until completed but was unable to get working.
----------------CODE BELOW--------------------
Const DB_CONNECT_STRING= "provider=SQLOLEDB.1;data
source=localhost;database=PSMT;uid=mydbUser;pwd=???????"
Set MyDB = CreateObject("ADODB.Connection")
MyDB.Open(DB_CONNECT_STRING)
SQLString = "select SystemName, Win32_ComputerSystem_TotalPhysicalMemory,
OSInstallDate, LAST_UPDATED from SystemInfo where
(Win32_ComputerSystem_TotalPhysicalMemory) < 120746688"
set MemQuery = MyDB.Execute(SQLString)
If Not MemQuery.EOF then
SystemName = MemQuery.Fields("SystemName")
PhysicalMem = MemQuery.Fields("Win32_ComputerSystem_TotalPhysicalMemory")
OSINstallDate = MemQuery.Fields("OSInstallDate")
LastUpdated = MemQuery.Fields("LAST_UPDATED")
WScript.Echo(SystemName & vbtab & PhysicalMem & vbtab & OSINstallDate &
vbtab & LastUpdated)
End if
MyDB.Close