[AccessD] OT: Getting data from .txt into VB or web page

Drew Wutka DWUTKA at marlow.com
Wed Feb 5 09:31:00 CST 2003


ADO can 'read' text files.  But things can get a little hairy if the text
file doesn't have a straight forward 'layout'.  

Drew

-----Original Message-----
From: Roz Clarke
To: 'accessd at databaseadvisors.com'
Sent: 2/5/03 3:19 AM
Subject: RE: [AccessD] OT: Getting data from .txt into VB or web page

Actually I had got as far as setting up a DSN for the file using the
text
ODBC driver (a new discovery). It seems to work for the .asp page tho' I
couldn't persuade Jet to use it when I was testing it out.

Roz

-----Original Message-----
From: Drew Wutka [mailto:DWUTKA at marlow.com] 
Sent: 04 February 2003 17:47
To: 'accessd at databaseadvisors.com'
Subject: RE: [AccessD] OT: Getting data from .txt into VB or web page


With ASP, you would need to use the FileSystemObject.  UNLESS you make a
VB
.dll, that does the work from you (then you can use basic File I/O
statements).

Drew

-----Original Message-----
From: Roz Clarke [mailto:roz.clarke at donnslaw.co.uk]
Sent: Tuesday, February 04, 2003 6:14 AM
To: 'accessd at databaseadvisors.com'
Subject: RE: [AccessD] OT: Getting data from .txt into VB or web page


Very elegant... Thank you. I'm sure it will help, and be easier for me
than
trying to do it in .asp which I'm having a bit of a hrad time with!!

Cheers

Roz

-----Original Message-----
From: paul.hartland at fsmail.net [mailto:paul.hartland at fsmail.net] 
Sent: 04 February 2003 11:57
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] OT: Getting data from .txt into VB or web page


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


_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list