Sponsor Advertisements
Sponsor Advertisements
|
|
|
Sponsor Advertisements
Sponsor Advertisements
|
|
#17840 - 07/30/03 02:01 PM
Re: need hlp with databases pls...
|
DollarDNS Owner
Registered: 03/04/02
Posts: 1273
Loc: OH, USA
|
You know what? Screw it. Let's go the INI file route cause it's easier. Add the following 2 lines to the top of your form code:
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
Private Sub Form_Load() SaveUser "John", "Doe" MsgBox GetPass("John") End Sub
Use the following 2 routines
Private Sub SaveUser(User As String, Pass As String) WritePrivateProfileString "userlist", User, Pass, App.Path & "\users.ini" End Sub
Private Function GetPass(User As String) As String Dim Pass As String * 255, PassLength As Long PassLength = GetPrivateProfileString("userlist", User, "", Pass, 255, App.Path & "\users.ini") If PassLength > 0 Then GetPass = Left(Pass, PassLength) End Function
Tell me if you can't figure out how to use this. The code above is all you need to know to save/load user information. Then comes the encoding.
|
|
Top
|
|
|
|
|
Registered: 03/02/02
Posts: 134
|
|
2200 Members
46 Forums
25392 Topics
60562 Posts
Max Online: 1567 @ 04/25/10 10:20 AM
|
|
|
0 registered (),
289
Guests and
313
Spiders online. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|