|
-
Jan 5th, 2001, 03:07 AM
#1
Thread Starter
Lively Member
How to create a workspace in vb 6?
Hi,
What is a workspace? Can anyone teach me how to create a workspace in vb 6?
The following is some codes that create workspace in vb 3. However when I load them in vb 6, it says
"Can't start your application. The workgroup information is missing or opened exclusively by another user."
Can somebody help me with this?
Thank you very much.
************************************************************
Private Sub cmdEnter_Click()
Dim myAccess As dynaset
Dim SQL As String
If txtID.Text = "" Then
MsgBox "Enter your ID"
txtID.SetFocus
Exit Sub
End If
If txtPassword.Text = "" Then
MsgBox "Enter your Password"
txtPassword.SetFocus
Exit Sub
End If
' to check id & password if correct??
On Error GoTo err_hand
SetDefaultWorkspace txtID.Text, txtPassword.Text
usr_id = txtID.Text
usr_password = txtPassword.Text
Dim loctext
loctext = LCase(App.Path)
If Right(App.Path, 1) <> "\" Then loctext = loctext + "\" 'handles the root
data_base = txt_path.Text
Set tr_db = OpenDatabase(data_base)
Set letter_set = tr_db.CreateDynaset("letter")
AccessLevel = 0
SQL = "Select AccessLevel from UserAccessLevel where LoginID = '" & usr_id & "'"
Set myAccess = tr_db.CreateDynaset(SQL)
If myAccess.RecordCount > 0 Then
AccessLevel = myAccess("AccessLevel")
Else
AccessLevel = 1
End If
myAccess.Close
db_path = txt_path.Text
MainMenu.Show
Unload Form1
Exit Sub
err_hand:
MsgBox (Error)
txtID.Text = ""
txtPassword.Text = ""
txtID.SetFocus
Exit Sub
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|