ServerId = x
iNumSlots = 3
iNumLinesPerSlot = 2
SQL = "DELETE FROM ServerPorts WHERE ServerId = " & ServerId
rstThird.Open SQL, conMain, adOpenForwardOnly, adLockOptimistic
For iCountSlots = 0 To iNumSlots
For iCountLines = 0 To iNumLinesPerSlot
For iCountPorts = 0 To 31
iPortNum = iCountPorts + (iCountLines * 32) + (iCountSlots * 1024)
SQL = "INSERT INTO ServerPorts (ServerId, Port) VALUES (" &
ServerId & "," & iPortNum & ")"
rstThird.Open SQL, conMain, adOpenForwardOnly, adLockOptimistic
Next
Next
Next
Hope this helps someone in the future
Regards,
Graeme
---Graeme Slogrove, BSc (Eng) Elec (Wits)Director, Systems Development & Value Added ServicesNetActive InternetTel: 011-719-0333 Fax: 011-719-0444Support: 011-719-0300
For more information about this list (including removal) go to:http://www.iea-software.com/support/maillists/liststart