![]() Loading |
VBScript |
JavaScript |
Powershell |
Search Options: Search for a Record in a Recordset
|
||
' Description: Searches an ADO database with a DSN of "Inventory" looking for a specific computer record.
Const adOpenStatic = 3 Const adLockOptimistic = 3 Const adUseClient = 3 Set objConnection = CreateObject("ADODB.Connection") Set objRecordset = CreateObject("ADODB.Recordset") objConnection.Open "DSN=Inventory;" objRecordset.CursorLocation = adUseClient objRecordset.Open "SELECT * FROM Hardware" , objConnection, _ adOpenStatic, adLockOptimistic strSearchCriteria = "ComputerName = 'WebServer'" objRecordSet.Find strSearchCriteria If objRecordset.EOF Then Wscript.Echo "Record cannot be found." Else Wscript.Echo "Record found." End If objRecordset.Close objConnection.Close | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |