<% Response.Buffer = true %> <% Dim RecordSet, strSQL, strUsername strUsername = Request.Form("Username") strSQL = "SELECT Alias FROM StaffList" Set RecordSet = Server.CreateObject("ADODB.Recordset") RecordSet.Open strSQL, databaseConnection Do Until RecordSet.EOF If(StrComp(RecordSet("Alias"), strUsername) = 0) Then Response.Write ("You are staff") Else RecordSet.MoveNext Loop RecordSet.Close Set RecordSet = Nothing databaseConnection.Close Set databaseConnection = Nothing %> The ASP code for connection.asp: <% Dim databaseConnection Set databaseConnection = Server.CreateObject("ADODB.Connection") databaseConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("/intranet/IntranetDB.mdb") & ";" databaseConnection.Open %> Please tell me what do you observe? I'm really stuck. Thank you. [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => tabonni [ip] => tabonni@yahoo.c [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 1 [attachments] => [allattachments] => ) --> > <% Response.Buffer = true %> > <% > > Dim RecordSet, strSQL, strUsername > > strUsername = Request.Form("Username") > > strSQL = "SELECT Alias FROM StaffList" > > Set RecordSet = Server.CreateObject("ADODB.Recordset") > RecordSet.Open strSQL, databaseConnection > > Do Until RecordSet.EOF > If(StrComp(RecordSet("Alias"), strUsername) = 0) Then > Response.Write ("You are staff") > Else > RecordSet.MoveNext > Loop > > RecordSet.Close > Set RecordSet = Nothing > databaseConnection.Close > Set databaseConnection = Nothing > %> > > The ASP code for connection.asp: > <% > Dim databaseConnection > Set databaseConnection = Server.CreateObject("ADODB.Connection") > databaseConnection.ConnectionString = > "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & > Server.MapPath("/intranet/IntranetDB.mdb") & ";" > databaseConnection.Open > %> > > Please tell me what do you observe? I'm really stuck. > > Thank you.[/ref] Take a closer look at your code: Do Until RecordSet.EOF If(StrComp(RecordSet("Alias"), strUsername) = 0) Then Response.Write ("You are staff") Else RecordSet.MoveNext Loop When there's a match you're in an infinite loop! Either add "RecordSet.MoveNext" after your "Response.Write()" or, better yet, write asn effective SQL statement; something like: strSQL = "SELECT Alias FROM StaffList" strSQL = strSQL & " WHERE Alias ='" & strUsername &"'" If Not RecordSet.EOF Then Response.Write ("You are staff") End If [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => McKirahan [ip] => News@McKirahan. [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 2 [attachments] => [allattachments] => ) --> <% Response.Buffer = true %> <% Dim RecordSet, strUsername,strSQL strUsername = TRIM(Request.Form("Username")) strSQL = "SELECT [Alias] FROM StaffList WHERE [Alias]='" & strUsername & "'" Set RecordSet = Server.CreateObject("ADODB.Recordset" RecordSet.Open strSQL, databaseConnection If NOT RecordSet.EOF Then Response.Write "You are staff" Else Response.Write "You are NOT staff" End If RecordSet.Close Set RecordSet = Nothing databaseConnection.Close Set databaseConnection = Nothing %> I'm wondering it is something wrong on the procedure when I connect the MS Exchange to MS Access. [New Table -> Link Table -> File of Type [I choose Exchange()] -> Choose "Global Adress List" -> Rename to "StaffList -> Finish]. I tried to choose Exchange() and Outlook(). But, I still can't make it work. BTW, what's the difference between Exchange() and Outlook()? Thank you. "Ray Costanzo [MVP]" wrote in message news:...[ref] > Not to mention he could just make use of a WHERE clause and skip the loop > altogether. > > Ray at work > > "McKirahan" wrote in message > news:ASrbd.238350$.. >[ref] > > > > Take a closer look at your code: > > > > Do Until RecordSet.EOF > > If(StrComp(RecordSet("Alias"), strUsername) = 0) Then > > Response.Write ("You are staff") > > Else > > RecordSet.MoveNext > > Loop > > > > When there's a match you're in an infinite loop! > > > > Either add "RecordSet.MoveNext" after your "Response.Write()" or, better > > yet, write asn effective SQL statement; something like: > > > > strSQL = "SELECT Alias FROM StaffList" > > strSQL = strSQL & " WHERE Alias ='" & strUsername &"'" > > > > If Not RecordSet.EOF Then > > Response.Write ("You are staff") > > End If > > > >[/ref][/ref] [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => tabonni [ip] => tabonni@yahoo.c [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 5 [attachments] => [allattachments] => ) -->