8 Replies - 4729 Views - Last Post: 21 June 2007 - 06:58 PM Rate Topic: -----

#1 icebox10  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 15-June 07

problem with multiple users program

Post icon  Posted 15 June 2007 - 01:39 AM

hi good day to all, i want to seek some possible solutions in making my
program run in multiple users.im new in visual basic i make a simple program
but it only work for single user i want to make it available for at least 5
users to log in with their own password.can someone please help me.
thank you very much to all.....
here is my sample program
Private Sub cmdok_Click()
If txtPass = "admin" Then
MsgBox ("Welcome!! " & txtUser.Text & " You have been logged in")
frmWelcome.lblWelcome.Caption = "Welcome "
frmAuth.txtUser.Text = A
frmAuth.Hide
frmMonitoring.Show
Else
MsgBox ("Sorry!! You are not authorized to log in. Please Try Again ")
End If
End Sub


MOD EDIT: Code Tags Added

Is This A Good Question/Topic? 0
  • +

Replies To: problem with multiple users program

#2 born2c0de  Icon User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 180
  • View blog
  • Posts: 4,667
  • Joined: 26-November 04

Re: problem with multiple users program

Posted 15 June 2007 - 01:58 AM

You will need to store the Usernames and Passwords in a Data File or a Database.
Are you acquainted with Visual Basic File Handling, ADODC or Data Control, ADODB Programming or Arrays?

We need such information so that we can provide you with some material which will teach you these concepts.
Was This Post Helpful? 0
  • +
  • -

#3 icebox10  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 15-June 07

Re: problem with multiple users program

Posted 15 June 2007 - 02:46 AM

View Postborn2c0de, on 15 Jun, 2007 - 01:58 AM, said:

You will need to store the Usernames and Passwords in a Data File or a Database.
Are you acquainted with Visual Basic File Handling, ADODC or Data Control, ADODB Programming or Arrays?

We need such information so that we can provide you with some material which will teach you these concepts.



im not familiar with visual basic file handling yet, please help me how to start the same kind of program so that i have a guide on how to finish my project. thanks again..
Was This Post Helpful? 0
  • +
  • -

#4 born2c0de  Icon User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 180
  • View blog
  • Posts: 4,667
  • Joined: 26-November 04

Re: problem with multiple users program

Posted 15 June 2007 - 10:31 AM

I'm almost finished writing the "VB6 File Handling Tutorial"
Check it out in the Visual BASIC Tutorials Section in about 2 to 3 days.
Was This Post Helpful? 0
  • +
  • -

#5 icebox10  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 15-June 07

Re: problem with multiple users program

Posted 18 June 2007 - 01:39 AM

i already make another table in my database for username and password below is my new code but i have error " OBJECT VARIABLE OR WITH BLOCK VARIABLE NOT SET "


Private Sub cmdok_Click()
Set DBMonitor = OpenDatabase("c:\desktop\CoorSystem.mdb")
  SaveCounter = "Browse"
If txtUser = RSAOR.Fields("USERNAME") Then
 txtPass = RSAOR.Fields("PASSWORD")
  End If
  If txtPass = True Then
 MsgBox ("Welcome!! " & txtUser.Text & " You have been logged in")
frmWelcome.lblWelcome.Caption = "Welcome "
frmAuth.txtUser.Text = A
frmAuth.Hide
frmMonitoring.Show
Else
MsgBox ("Sorry!! You are not authorized to log in. Please Try Again ")
End If
End Sub

Was This Post Helpful? 0
  • +
  • -

#6 born2c0de  Icon User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 180
  • View blog
  • Posts: 4,667
  • Joined: 26-November 04

Re: problem with multiple users program

Posted 18 June 2007 - 07:15 AM

Usually this happens when an object is used when memory is not allocated for it.
Since you haven't declared the DBMonitor object, VB Assumes that it is a Variant. The Set Statement doesn't work very well with Variants.

You will also need to use the New Operator to get it to work.
For Example:
Dim xyz As Object
Set xyz = New Object

' Now use the xyz Object as you wish

Was This Post Helpful? 0
  • +
  • -

#7 icebox10  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 15-June 07

Re: problem with multiple users program

Posted 20 June 2007 - 08:09 PM

thanks its running now...
my new problem is on the frmmonitoring code error
"invalid use of null" what would be the problem ?here's my code.
thanks in advance.

Private Sub Form_Load()
	Set DBMonitor = OpenDatabase("c:\Documents and settings\corbdrae\desktop\Personnel Coors\DataBase\Coor-Personnel System.mdb")
		Set RSMonitor = DBMonitor.OpenRecordset("Leave-Shift")
	Set RSName = DBMonitor.OpenRecordset("New Applicant")
	Set RSAOR = DBMonitor.OpenRecordset("AOR")
		SaveCounter = "Browse"
	RSName.MoveFirst
	Do Until RSName.EOF
		Combo1.AddItem UCase(RSName.Fields("Name"))
		Combo3.AddItem UCase(RSName.Fields("Name"))
		RSName.MoveNext
	Loop
	RSName.MoveFirst
	Do Until RSAOR.EOF
		Combo2.AddItem UCase(RSAOR.Fields("AOR"))  = ivalid use of null
		RSAOR.MoveNext
	Loop
	Call Visible_Leave
End Sub

Was This Post Helpful? 0
  • +
  • -

#8 born2c0de  Icon User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 180
  • View blog
  • Posts: 4,667
  • Joined: 26-November 04

Re: problem with multiple users program

Posted 21 June 2007 - 02:34 AM

Try this:
Combo2.AddItem UCase(RSAOR.Fields("AOR").Value)

Was This Post Helpful? 0
  • +
  • -

#9 icebox10  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 15-June 07

Re: problem with multiple users program

Posted 21 June 2007 - 06:58 PM

i've tried your suggestion but the error is the same


= Combo2.AddItem UCase(RSAOR.Fields("AOR").value) "invalid use of null"
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1