Your browser does not seem to support CSS. If images appear below, please disregard them.
toggle
May
S M T W T F S
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
Sponsored Links
Latest Postings
Topic Options
Rate This Topic
#17831 - 07/29/03 08:29 AM need hlp with databases pls...
Joined: Jul 2003
Posts: 6
Duckman Offline
Junior Member
Duckman Offline
Junior Member

Joined: Jul 2003
Posts: 6
Canada
im new to vb so pls dont critisize me.. anyway i dont know how to make a database.. i am trying to make a password protection program. I have the Account Name and Password text boxes and i need to make the database for the acc names and the passwords for the users... someone pls hlp...

Top
Sponsored Links
#17832 - 07/29/03 09:24 AM Re: need hlp with databases pls...
Joined: Mar 2002
Posts: 1,273
SilentRage Offline
DollarDNS Owner
SilentRage Offline
DollarDNS Owner

Joined: Mar 2002
Posts: 1,273
OH, USA
The first question you need to ask yourself, is do you really NEED a database? It seems to me that if all you are gonna store is usernames and passwords, you should instead store usernames and passwords into a normal file and encrypt the information. Trust me, a user/pass file with encryption is easier than the database option.

So what will it be jack? database or file?


Domain Registration, Hosting, Management
http://www.dollardns.net
Top
#17833 - 07/29/03 10:26 AM Re: need hlp with databases pls...
Joined: Jul 2003
Posts: 6
Duckman Offline
Junior Member
Duckman Offline
Junior Member

Joined: Jul 2003
Posts: 6
Canada
Thanks for the info SR. Only problem is that I have no experiance on how to encrypt text in files. Oh and I think I will go with the normal file. Thanks again.

Top
#17834 - 07/29/03 10:46 AM Re: need hlp with databases pls...
Joined: Mar 2002
Posts: 1,273
SilentRage Offline
DollarDNS Owner
SilentRage Offline
DollarDNS Owner

Joined: Mar 2002
Posts: 1,273
OH, USA
second question. Do you want to use a secure encryption algorithm that already exists out there on the internet and is used for many things, or do you want to use a simple encoding algorithm which can be broken by even the more amateur of crackers (like myself)?


Domain Registration, Hosting, Management
http://www.dollardns.net
Top
#17835 - 07/29/03 10:49 AM Re: need hlp with databases pls...
Joined: Jul 2003
Posts: 6
Duckman Offline
Junior Member
Duckman Offline
Junior Member

Joined: Jul 2003
Posts: 6
Canada
What ever would be easiest until I learn the language. This is only a basic password form for my first program which will probably turn into trash lol. So I would probably have to say your second choice.

Top
#17836 - 07/29/03 11:03 AM Re: need hlp with databases pls...
Joined: Mar 2002
Posts: 1,273
SilentRage Offline
DollarDNS Owner
SilentRage Offline
DollarDNS Owner

Joined: Mar 2002
Posts: 1,273
OH, USA
Do you have any knowledge of file accessing in VB?


Domain Registration, Hosting, Management
http://www.dollardns.net
Top
#17837 - 07/29/03 07:38 PM Re: need hlp with databases pls...
Joined: Jul 2003
Posts: 6
Duckman Offline
Junior Member
Duckman Offline
Junior Member

Joined: Jul 2003
Posts: 6
Canada
I have very little knowledge of VB whatsoever. Sorry if I'm such an idiot when it comes to this but I'm starting to learn.

Top
#17838 - 07/30/03 01:28 AM Re: need hlp with databases pls...
Joined: Mar 2002
Posts: 1,273
SilentRage Offline
DollarDNS Owner
SilentRage Offline
DollarDNS Owner

Joined: Mar 2002
Posts: 1,273
OH, USA
Here's the code to an example of how to save and load files. You tell the SaveFile subroutine the path of the file you'd like to save to, and the contents you'd like to save into it. The LoadFile function returns the file contents specified in the path you gave it. On Error Resume Next line tells VB to stuff their errors where the sun don't shine so that it doesn't crash your program if a file doesn't exist or there's permission errors or something.

Copy SaveFile and LoadFile and use in your project. Tell me when you get this code working good in your program and then we'll get a simple encoding algorithm to prevent easy snooping of the information in the file. Unless you don't care of the contents of the file is readable.

Private Sub Form_Load()
SaveFile "C:\example.txt", "hello" & vbcrlf & "bob"
MsgBox LoadFile("C:\example.txt")
End Sub

Private Sub SaveFile(Filename As String, Data As String)
On Error Resume Next
Open Filename For Output As #1
Print #1, Data;
Close #1
End Sub

Private Function LoadFile(Filename As String) As String
On Error Resume Next
Open Filename For Input As #1
LoadFile = Input(LOF(1), #1)
Close #1
End Function


Domain Registration, Hosting, Management
http://www.dollardns.net
Top
#17839 - 07/30/03 10:16 AM Re: need hlp with databases pls...
Joined: Jul 2003
Posts: 6
Duckman Offline
Junior Member
Duckman Offline
Junior Member

Joined: Jul 2003
Posts: 6
Canada
Thanks SR but I'm having some troubles understanding this. How would I set it so that the program would load usernames and passwords from a text file? Also after that I will need help on simple encryption of the passwords and usernames that are in this text file. I'm sorry if I am causing any frustration to you and thank you very much for taking your time to help me.

Top
#17840 - 07/30/03 01:01 PM Re: need hlp with databases pls...
Joined: Mar 2002
Posts: 1,273
SilentRage Offline
DollarDNS Owner
SilentRage Offline
DollarDNS Owner

Joined: Mar 2002
Posts: 1,273
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.


Domain Registration, Hosting, Management
http://www.dollardns.net
Top

Member Spotlight
Gremelin

Gremelin
Portland, OR; USA
Posts: 7,194
Joined: February 2002
Show All Member Profiles 
Forum Statistics
Forums46
Topics45,556
Posts80,724
Members2,157
Most Online1,567
Apr 25th, 2010
Top Posters(All Time)
UGN Security 38,720
Gremelin 7,194
§intå× 3,255
SilentRage 1,273
Ice 1,146
pergesu 1,136
Infinite 1,041
jonconley 955
Girlie 908
unreal 860
Newest Members
Herbert_Sherbert, codemauve, Lillysdragon1984, Brewwit, boa
2157 Registered Users
Who's Online Now
0 registered members (), 2 guests and 2 spiders.
Latest News