Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 19th, 2005, 07:43 AM
beginner81 beginner81 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 1 beginner81 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 m 35 sec
Reputation Power: 0
Cannot Access table with ADO

Well I have have a table userlist and a function searchuser() und when the username and password entered matches with the any of record in table userlist, the function set the value to true. I am however getting problems in accessing the table because i get an error Username or password invalid, am i doing something wrong in opening recordset or is there problem in find methods? need your ideas to solve this problem.




Function searchuser()
As Integer
Dim user%Dim Parent%
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim criteria As String
Set conn = CurrentProject.Connection
Set rs= New ADODB.Recordset
rs.Open _ "SELECT * FROM Userlist", _ conn, adOpenDynamic, adLockOptimistic
criteria = "[USER] = """ & Forms![Login]!USER & """"
' FindFirst implementation
rs.Find criteria, 0, adSearchForward, 1
If rs.EOF = False Then If rs!Password = Forms![Login]!Password
Then loc_user_ID= rs![ID]
dummy = True
Else ' search next user
Do
' FindNext Implementation
rs.Find criteria, adSearchForward, 0
If rs.EOF = False
Then If rs!Password = Forms![Login]!Password
Then loc_user_ID = rs![ID]
dummy = True
Exit
Do
End If
End If
Loop While rs.EOF = False
End If
Else ' no record found
dummy = False
End If
curr_user = Forms![Login]!USER
rs.Close
conn.Close .....

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Cannot Access table with ADO


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT