Sorry for "spamming" But this is really really important for a school project.
1. Can anyone of you paste me back the whole code that will make a textbox
saying,"username already taken" When you try to create different account with same username.
2. If possible, publishing the program and then people creates accounts and it saves
on 1 server that will let them login from different computers, because this won't work
with other people from other computers.

Thanks once again / macbrutal

------------------------------------------------------------------------
Private Sub Command1_Click()
Dim namefile As String
namefile = Text1.Text

Open App.Path & "\Accounts\" + namefile + ".txt" For Output As #1
Print #1, Text1.Text
Print #1, Text2.Text
Print #1, Text3.Text
Print #1, Text4.Text
Close #1

MsgBox "Thank you for your registration, please login!"
Form2.Show
Form1.Hide

End Sub

Recommended Answers

All 5 Replies

We're here to help, not do your school work!

I'm more than happy to point you in the right direction, but you have to help your self

What are :
text1..text
text2.text
text3.text
text4.text

May I suggest a naming convention
for example a text box, prefix the name with txt

if you want to save your data in one server then make your connection direct to that server...

data source="\\servername"

and how about the usernames and pw? where did you store it? I guess its in the database...

please be more specific...

regards,

jireh

#Busman_222.
I just want the program to look up in the "Account" folder, after a namefile that's been registered, and if so then msgbox "username already exists"
text1.text = Username
text2.text = Password
Skip the rest of it.
#Jireh.
Open App.Path & "\Accounts\" + namefile + ".txt" For Output As #1
It saves in the account folder i have where the project is saved.

You think you can help me ?

Are you using the text file as a database?

using text files for username/passwords are not idea, MS Access would be better because you can have tables and use SQL to speed up the program.

How are you opening the text file to check the username/password against the users input? (random or input)

What you could do is :
load the whole file (depending on size) to an array then then search the array
Could always check the file line by line, (not very good practice) for the username.

You need to think which way you want before you can code. Either way that function will contain a loop to carry this out

I agree to bushman, its not good to store usernames and passwords in a txtfile... they are prone in hacking... its better to put that on a database...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.