username and password in a data file??? which kind of security is that?
To write two strings in a binary file:
Code:
Dim f As Integer
f = FreeFile
Open "c:\s.dat" For Binary Access Write As f
Dim u As Variant
Dim p As Variant
u = "My user account"
p = "My password"
Put f, , u
Put f, , p
Close f
and to read them:
Code:
Open "c:\s.dat" For Binary Access Read As f
Get f, , u
Get f, , p
Close f
The strings must be in a Variant so VB knows how to convert them from the file.
But careful: anyone can open the file in notepad and read them!
Marco
Bookmarks