paul.hartland at fsmail.net
paul.hartland at fsmail.net
Tue Feb 4 05:58:00 CST 2003
Roz, here's some Visual Basic 6 code Dim srvname As String Dim srvusers As Integer Dim servername As String Dim serverusers As Integer serverusers = 9999 Open "D:\TestCSV.CSV" For Input As #1 ' Open file. Do While Not EOF(1) ' Loop until end of file. Input #1, srvname, srvusers ' Get one character. If (srvusers < serverusers) Then serverusers = srvusers servername = srvname End If Loop Close #1 ' Close file. MsgBox servername & " " & serverusers servername and serverusers will provide you with the servername that has the least amount of users.....(as long as at least one has less than 9999 connections). It gets it's counts from a comma seperated file called TestCSV.csv from path D:\ any questions contact me here or off-line.........hope this helps.......... Paul From: Roz Clarke <roz.clarke at donnslaw.co.uk> Date: Tue 04/Feb/2003 11:20 GMT To: "'accessd at databaseadvisors.com'" <accessd at databaseadvisors.com> Subject: [AccessD] OT: Getting data from .txt into VB or web page Hello all This isn't an Access question but I can't think of any better people to ask. I've been tasked with writing a logon application for our Terminal Server network that will take the user's username & password, and then query a text file to find out which of the application servers is the least busy, before connecting the user to that server. The text file will be in the format serverA,18 serverB,4 serverC,12 etc., where the number is the number of currently connected users. I don't even know where to start. The notwork guy is keen for me to make it browser based, but I don't see what advantages that would have over a little VB app. Either way I don't know how to get the data out of that .txt file. Is that enough info for anyone to help? Any pointers? TIA Roz __________________________________________________________________________ Freeserve AnyTime - Go online whenever you want for just £6.99 a month for your first 3 months, that's HALF PRICE! And then it's just £13.99 a month after that. For more information visit http://www.freeserve.com/time/ or call free on 0800 970 8890