Welcome to Dream.In.Code
Become a VB Expert!

Join 137,271 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,437 people online right now. Registration is fast and FREE... Join Now!




Help regarding some program logic

 
Reply to this topicStart new topic

Help regarding some program logic

krishnak27
22 Nov, 2006 - 10:37 PM
Post #1

New D.I.C Head
*

Joined: 21 Nov, 2006
Posts: 4


My Contributions
I have database as follows

table name :users
Fields: name,uid,pwd,confirmpwd

I have designed a form in VB 6 to signup if he is new user and he has entered the data and clicked on submit button it should check from the database whether it exists or not. I want the logic for this problem specified in visual basic 6 and database is access.it should check the fields should not be null if null again has to reenter the details and then only the userid and pwd should be created.

Please give me the solution for this problem.


User is offlineProfile CardPM
+Quote Post

eXceed69
RE: Help Regarding Some Program Logic
22 Nov, 2006 - 10:41 PM
Post #2

"Super Sentai Knight Of DawN"
Group Icon

Joined: 12 Nov, 2006
Posts: 682



Thanked: 1 times
Dream Kudos: 675
My Contributions
Well first thing you should do is create a table on access....

Code to the VB6..then code an connection to your database ..hmmm

ODBC connection....then you could post your progress here...
User is offlineProfile CardPM
+Quote Post

krishnak27
RE: Help Regarding Some Program Logic
22 Nov, 2006 - 10:49 PM
Post #3

New D.I.C Head
*

Joined: 21 Nov, 2006
Posts: 4


My Contributions
Private Sub cmdsubmit_Click()
Dim s As String
RS.Close
RS.Open "select * from users", CN
s = RS(1)
RS.AddNew

Do While (txtname.Text <> "" And txtuid.Text <> "" And txtpwd.Text <> "" And txtconfirmpwd.Text <> "")
If (txtname.Text = "" Or txtuid.Text = "") Or (txtpwd.Text = "" Or txtconfirmpwd.Text = "") Then
txtname.SetFocus
End If
RS(0) = txtname.Text
If s = txtuid.Text Then MsgBox "User Id already exists", vbCritical + vbInformation, "User Exists"
txtuid.SetFocus
If s <> txtuid.Text Then
RS(1) = txtuid.Text
RS(2) = txtpwd.Text
ElseIf RS(2) = txtconfirmpwd.Text Then RS(3) = txtconfirmpwd.Text
Else
MsgBox "Confirm Password must be same ", vbCritical + vbInformation, "Wrong Password"
txtconfirmpwd.SetFocus
End If
RS.Update
MsgBox "User Id and Password Created "
Loop
MsgBox "Enter Data", vbInformation
txtname.SetFocus

this way i have given the code
User is offlineProfile CardPM
+Quote Post

eXceed69
RE: Help Regarding Some Program Logic
22 Nov, 2006 - 10:53 PM
Post #4

"Super Sentai Knight Of DawN"
Group Icon

Joined: 12 Nov, 2006
Posts: 682



Thanked: 1 times
Dream Kudos: 675
My Contributions
I found something for you...take a look on it

http://www.dreamincode.net/forums/showtopic11308.htm

Try to used the search buttons...

This post has been edited by eXceed69: 22 Nov, 2006 - 10:54 PM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/4/08 07:51PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month