UGN Security Forums
My ProfileMember DirectoryLogin
Search our ForumsView our FAQView our Site Rules
View our CalendarView our Active TopicsGo to our Main Page

UGN Security Store
 

Network Sites UGN Security, The GoNix Initiative, Elite Web Gamers, Back of the Web, EveryDay Helper, VNC Web Design & Development
December
Su M Tu W Th F Sa
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
Latest Reviews
Topic Options
Rate This Topic
#17831 - 07/29/03 04:29 AM need hlp with databases pls...
Duckman Offline
Junior Member

Registered: 07/18/03
Posts: 6
Loc: 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 05:24 AM Re: need hlp with databases pls...
SilentRage Offline
DollarDNS Owner

Registered: 03/04/02
Posts: 1273
Loc: 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 06:26 AM Re: need hlp with databases pls...
Duckman Offline
Junior Member

Registered: 07/18/03
Posts: 6
Loc: 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 06:46 AM Re: need hlp with databases pls...
SilentRage Offline
DollarDNS Owner

Registered: 03/04/02
Posts: 1273
Loc: 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 06:49 AM Re: need hlp with databases pls...
Duckman Offline
Junior Member

Registered: 07/18/03
Posts: 6
Loc: 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 07:03 AM Re: need hlp with databases pls...
SilentRage Offline
DollarDNS Owner

Registered: 03/04/02
Posts: 1273
Loc: 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 03:38 PM Re: need hlp with databases pls...
Duckman Offline
Junior Member

Registered: 07/18/03
Posts: 6
Loc: 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/29/03 09:28 PM Re: need hlp with databases pls...
SilentRage Offline
DollarDNS Owner

Registered: 03/04/02
Posts: 1273
Loc: 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 06:16 AM Re: need hlp with databases pls...
Duckman Offline
Junior Member

Registered: 07/18/03
Posts: 6
Loc: 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 09:01 AM Re: need hlp with databases pls...
SilentRage Offline
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.
_________________________
Domain Registration, Hosting, Management
http://www.dollardns.net

Top

Featured Member
Registered: 10/28/14
Posts: 1
Forum Stats
2152 Members
46 Forums
36281 Topics
71451 Posts

Max Online: 1567 @ 04/25/10 05:20 AM
Top Posters
UGN Security 29442
Gremelin 7193
§intå× 3255
SilentRage 1273
Ice 1146
pergesu 1136
Infinite 1041
jonconley 955
Girlie 908
unreal 860
Newest Members
cdefgh368568, HushHush, golqm, Tim050, Gecko666
2151 Registered Users
Who's Online
0 registered (), 345 Guests and 325 Spiders online.
Key: Admin, Global Mod, Mod
Latest News


Donate
  Get Firefox!
Get FireFox!