Access

T

Trevin

I apologize up front...I am not a developer, so the
answer to this question may be pretty easy.

I was wondering if anybody could shed some light on a
technical problem we are experiencing. We have built a
small Access 2000 database for collecting clinical data.
The database has a logon screen with an OK button.
Currently, I have to install Visual Basic 6.0 on each
user's machine in order for the underlying VB code for
the OK button to work properly.

I am wondering if anybody knows of an easier way to
provide whatever the VB 6 cd is providing. Is there some
other (free?) Microsoft component I can install instead
of having to install VB every time and use up a license?

Thanks!

Trevin
 
B

Brendan Reynolds

What happens when VB6 is not installed? Is there an error message?

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
T

Trevin

When VB6 is not installed, there is no error message, and I can't get any
further than the logon screen. The system doesn't lock up or anything, it
just doesn't know what to do when you click on the button.

Trevin
 
J

John Vinson

I apologize up front...I am not a developer, so the
answer to this question may be pretty easy.

I was wondering if anybody could shed some light on a
technical problem we are experiencing. We have built a
small Access 2000 database for collecting clinical data.
The database has a logon screen with an OK button.
Currently, I have to install Visual Basic 6.0 on each
user's machine in order for the underlying VB code for
the OK button to work properly.

I am wondering if anybody knows of an easier way to
provide whatever the VB 6 cd is providing. Is there some
other (free?) Microsoft component I can install instead
of having to install VB every time and use up a license?

Thanks!

Trevin

It sounds like whoever built this app used some extra features from
VB6. Just having a logon screen with an OK button does NOT require any
extra features though - without seeing the code I'd have no idea what
they were doing nor how to replace it.

Can you hold down the SHIFT key and open the database bypassing the
logon (the developer may have disabled this too)? If so, can you post
the code?

John W. Vinson[MVP]
 
T

Trevin

Here's the code for the OK click event. It checks for blanks, makes a
connection to a SQL back-end, verifies credentials stored in the SQL table.
When VB6 is not installed, I get no response (no error message) at all.

************************************
Private Sub Ok_Click()
Dim response

' Check for blanks
If IsNull(Me!UserID) Or IsNull(Me!Password) Then
response = MsgBox("Cannot Have Blank User ID or Password.", 0, "Error")
If IsNull(Me!UserID) Then
Me.UserID.SetFocus
Else
Me.Password.SetFocus
End If
Exit Sub
End If

Dim dbs As Database
Dim rst As Recordset
Dim intCurrentRow As Integer
Dim qdf As QueryDef

Set dbs = CurrentDb
Set qdf = dbs.CreateQueryDef("")

With qdf
.Connect = "ODBC;DATABASE=STUDY_37_PRECLINICAL;UID=" & uid & ";PWD="
& pwd & ";DSN=STUDY37_PRECLIN;"
.SQL = "SELECT tbl_Scans_HomeUse.subject_id " & _
"FROM tbl_Scans_HomeUse " & _
"ORDER BY tbl_Scans_HomeUse.subject_id"
Set rst = .OpenRecordset()
End With

Set rst = dbs.OpenRecordset("Security")

'Search for user in table
With rst
Do While Not .EOF
If Trim(rst.UserName) = Trim(Me!UserID) And Trim(rst.Password) =
Trim(Me!Password) Then
response = MsgBox("Login successful.", 0, "Logged In")
m_username = Trim(Me!UserID)
dbs.Close
DoCmd.Close
DoCmd.OpenForm "frmMainMenu"
Exit Sub
End If
.MoveNext
Loop
End With

'Error message if user not found
response = MsgBox("Login incorrect. Please try again.", 0, "Error")
Me.UserID.SetFocus
Forms!frmLogin.Refresh

End Sub
 
Top