Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not in ?? 1

Status
Not open for further replies.

sparkbyte

Technical User
Sep 20, 2002
879
US
OK, not sure how to do sets.

Code:
Do Until objRecordSet.EOF
    strSystem = objRecordSet.Fields("Name").Value
	 objRecordSet.MoveNext
    [red]If Mid(strSystem,7,3) <> ("INT","DB","APP") Then[/red]
    WScript.Echo strSystem
    End If
Loop

What would be the correct syntax for this?



Thanks

John Fuhrman
Titan Global Services
 
You can use a dictionary...

Code:
Dim objDict : Set objDict = CreateObject("Scripting.Dictionary")
objDict.CompareMode = vbTextCompare
objDict.Add "INT", ""
objDict.Add "DB", ""
objDict.Add "APP", ""

If Not objDict.Exists(Mid(strTemp, 7, 3)) Then
	WScript.Echo strTemp
End If

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
If Mid(strSystem,7,3) <> "INT" _
And Mid(strSystem,7,3) <> "DB" _
And Mid(strSystem,7,3) <> "APP" Then
WScript.Echo strSystem
End If

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top