Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 03:32 PM
tabonni
Guest
 
Posts: n/a
Default Problem on querying Access link table in ASP page

Hi All

I connected MS Exchange Server to MS Access database using Access link
table function. I can open the database table and see the fields and
data inside the link table. However, the table seems cannot be queried
by SQL statement.

My situation is:
I'm building an intranet. I have a ASP login page for all staff in the
company to login. Other people can't register or login the intranet.
That's the reason I use the company email address to verify username
login name.

After I made the link to the Global Address List (rename to
StaffList), I can see the Alias field. I wrote ASP code to use Alias
field to verify user login name. But, the ASP page seems experiencing
difficulties. I always got the "Connection Timeout" Error.

The procedure I connect Exchange to Access:
[New Table -> Link Table -> File of Type [I choose Exchange()] ->
Choose "Global Adress List" -> Rename to "StaffList -> Finish]

My ASP code is as follow:

<%@ Language=VBScript %>
<!-- #INCLUDE VIRTUAL="/intranet/connection.asp" -->
<% 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.
  #2  
Old July 19th, 2005, 03:32 PM
Ray Costanzo [MVP]
Guest
 
Posts: n/a
Default Re: Problem on querying Access link table in ASP page

http://www.aspfaq.com/5003

Ray at work

"tabonni" <tabonni@yahoo.com> wrote in message
news:fb0148c2.0410131747.1c196072@posting.google.c om...[color=blue]
> Hi All
>
> I connected MS Exchange Server to MS Access database using Access link
> table function. I can open the databas[/color]


 

Bookmarks

Thread Tools

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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles