i am developing a human resources profiler system. the problem is that the system cannot log on on some machines giving me a 'runtime error 2147220999(800401f9) method of object_current project failed' pointing on the following line
rs.Open str_sel, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
my code is as follows - Option Compare Database
-
-
Private Sub ACCEPT_Click()
-
Dim ls_username, ls_username_1, ls_password, ls_password_1 As String
-
Dim str_sel As String
-
Dim rs As Recordset
-
Dim rs_count As Integer
-
ls_username = Me.User_name.Value
-
ls_password = Me.password.Value
-
-
'Set dbs = CurrentDb
-
str_sel = "SELECT * FROM USERS WHERE [USERNAME] = '" & ls_username & "';"
-
If IsNull(ls_username) Then
-
MsgBox "Please enter username", vbInformation, "Payroll Logon"
-
Else
-
Set rs = New ADODB.Recordset
-
rs.Open str_sel, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
-
-
'Set rs = openrecordset(str_sel)
-
rs_count = rs.RecordCount
-
If rs_count < 1 Then
-
MsgBox "Username Does not exist", vbCritical, "Payroll Logon"
-
Else
-
ls_password_1 = rs!password
-
If ls_password_1 <> ls_password Or IsNull(ls_password) Then
-
MsgBox "Please Enter Correct Password ", vbCritical, "Payroll Logon"
-
Else
-
gsusername = rs!Username
-
gsprofile = rs!Profile
-
gl_Full_name = rs!Full_name
-
'MsgBox " Username and password super", vbInformation, "btags"
-
DoCmd.Close
-
'DoCmd.OpenForm "rate", acNormal
-
End If
-
End If
-
DoCmd.OpenForm "main", acNormal
-
End If
-
End Sub
please help me out i am stranded
2 1624
iam developing a human resources profiler system. the problem is that the system cannot log on on some machines giving me a 'runtime error2147220999(800401f9) method of object_current project failed' pointing on the following line
rs.Open str_sel, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
my code is as follows
Option Compare Database
Private Sub ACCEPT_Click()
Dim ls_username, ls_username_1, ls_password, ls_password_1 As String
Dim str_sel As String
Dim rs As Recordset
Dim rs_count As Integer
ls_username = Me.User_name.Value
ls_password = Me.password.Value
'Set dbs = CurrentDb
str_sel = "SELECT * FROM USERS WHERE [USERNAME] = '" & ls_username & "';"
If IsNull(ls_username) Then
MsgBox "Please enter username", vbInformation, "Payroll Logon"
Else
Set rs = New ADODB.Recordset
rs.Open str_sel, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
'Set rs = openrecordset(str_sel)
rs_count = rs.RecordCount
If rs_count < 1 Then
MsgBox "Username Does not exist", vbCritical, "Payroll Logon"
Else
ls_password_1 = rs!password
If ls_password_1 <> ls_password Or IsNull(ls_password) Then
MsgBox "Please Enter Correct Password ", vbCritical, "Payroll Logon"
Else
gsusername = rs!Username
gsprofile = rs!Profile
gl_Full_name = rs!Full_name
'MsgBox " Username and password super", vbInformation, "btags"
DoCmd.Close
'DoCmd.OpenForm "rate", acNormal
End If
End If
DoCmd.OpenForm "main", acNormal
End If
End Sub
please help me out iam sranded
Hi ,
I have Some Question regarding your code.
What type of control this are??? -
ls_username = Me.User_name.Value
-
ls_password = Me.password.Value
-
if its textbox controls(I think So) then you should use -
ls_username = Me.User_name.text
-
ls_password = Me.password.text
-
2nd ly
??????? -
rs.Open str_sel, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
-
is currentproject is connection object(again i think so) then use only object name.provided that
1) you have a valid connection String
2)connection Object should be open before u open the recordset object -
rs.Open str_sel, CurrentProject, adOpenKeyset, adLockOptimistic
-
if CurrentProject is your Project name & Connection is the Connection Object
then the above mention code is OK .
Ok?
I wonder whether these machines might have out of date versions of some runtime modules, or Activex controls.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Peter A. Schott |
last post by:
Per subject - I realize I can copy/paste a line at a time into an interactive
session when I'm trying to debug, but was wondering if there is any tool out
there that allows me to copy sections of...
|
by: Skybuck Flying |
last post by:
Hi,
I needed a method to determine if a point was on a line segment in 2D. So I
googled for some help and so far I have evaluated two methods.
The first method was only a formula, the second...
|
by: DraguVaso |
last post by:
Hi,
For my application I need the following behavior: When I press F4 the cursor
has to move to the next line in my multiline textbox which begins with "0".
Finding lines starting with 0 isn't...
|
by: Double Echo |
last post by:
Hi all,
I'm using PHP 4.4.2, and use PHP on both the command-line and the web.
I am running PHP on SuSE 10 Linux , in a VMware 5.5 workstation, using
Apache 2.0.55 , on my Dell laptop. ...
|
by: Adi |
last post by:
Hello eveyone,
I wanna ask a very simple question here (as it was quite disturbing
me for a long time.)
My problem is to read a file line by line. I've tried following
implementations but still...
|
by: magix |
last post by:
Hi,
when I read entries in file i.e text file, how can I determine the first
line and the last line ?
I know the first line of entry can be filtered using counter, but how about
the last line...
|
by: Jacob Rael |
last post by:
Hello,
I have a simple script to parse a text file (a visual basic program)
and convert key parts to tcl. Since I am only working on specific
sections and I need it quick, I decided not to...
|
by: WStoreyII |
last post by:
the following code is supposed to read a whole line upto a new line
char from a file. however it does not work. it is producing weird
results. please help. I had error checking in there for...
|
by: xdevel |
last post by:
Hi, I don't understand option.
if I write:
#line 100 "file"
I change file numeration to start to line 100 but what "file" ?
any example?
|
by: =?Utf-8?B?QnJpYW4gQ29vaw==?= |
last post by:
This is an example of the data;
2007/07/27 11:00:03 ARES_INDICATION 010.050.016.002 404.2.01 (6511)
RX 74 bytes
2007/07/27 11:00:03 65 11 26 02 BC 6C AA 20 76 93 51 53 50 76 13
48...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |