[AccessD] OT-Can anyone help me with ASP problem (complete no vice)

DWUTKA at marlow.com DWUTKA at marlow.com
Thu May 20 10:49:33 CDT 2004


Paul, I replied to a similar email you sent on Friday.  You are trying to do
client side effects with ASP.  So I am not cluttering the list, look back
through the subject 'RE: [AccessD] OT-ASP OnChange To Call A Function' for
my reply, if you can't find it, let me know, and I'll send it off list
again.

Drew

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of
paul.hartland at fsmail.net
Sent: Thursday, May 20, 2004 4:24 AM
To: accessd
Subject: [AccessD] OT-Can anyone help me with ASP problem (complete
novice)


To all,
 
Firstly can anyone suggest a good asp list that's as excellent as this one
?.
 
Secondly is there anyone that can tell me what I'm doing wrong in the
following ASP code:
 
<%@ Language="VBScript" %>
<% Option Explicit %>
<!--#Include Virtual="/ADOVBS.inc"-->
 
<%
                Sub OfficeSelected()
 
strOffice=ddOffices.Options(ddOffices.SelectedIndex).Text
                                response.write strOffice
                End Sub
%>
 
<%
                Dim dbConn
                Dim rsCheck
                Dim rsOffice
                Dim strSQLAccess
                Dim strSQLOffice
                Dim strChkUser
                Dim strChkPass
                Dim strUser
                Dim strOffice
                
                Set dbConn=Server.CreateObject("ADODB.Connection")
                Set rsOffice=Server.CreateObject("ADODB.Recordset")
                Set rsCheck=Server.CreateObject("ADODB.Recordset")
                
                dbConn.ConnectionString=Server.MapPath("Genesis.mdb")
                dbConn.Provider="Microsoft.Jet.OLEDB.4.0"
                dbConn.Open
                
                strChkUser=request.form("Username")
                strChkPass=request.form("Password")
                strUser=UCase(Left(strChkUser,1)) &
LCase(Mid(strChkUser,2,(InStr(strChkUser,".")-1)))
                
                strSQLAccess="SELECT Username, Password FROM tblUsers WHERE
EnableUser=True AND Username='" & strChkUser & "' AND Password='" &
strChkPass & "'"
                
                Set rsCheck=dbConn.Execute(strSQLAccess)
                
                %>
                                <BODY background="niceblue.jpg">
                <%
 
                if ( rsCheck.EOF ) Then
                                %>
                                                <H2><FONT
color="Black"><CENTER><B><I>Username and/or Password Not
Recognised</I></B></CENTER></FONT></H2>
                                <%
                Else
                                strSQLOffice="SELECT OfficeName FROM
tblOffices"
 
                                Set rsOffice=dbConn.Execute(strSQLOffice)
 
                                If ( rsOffice.EOF=False ) Then
                                                rsOffice.MoveFirst
                                                response.write
"<H2><CENTER><FONT color='White'>Welcome To The Orridge Internet Reporting
System " & strUser & "</FONT></CENTER></H2>"
                                                response.write "<HR
WIDTH='100%'>"
                                                response.write "<FONT
color='White'><B>Please Select An Office:</B></FONT>"
 
                                                %>
 
<DEFANGED_SELECT name='ddOffices' onchange='OfficeSelected()'>
 
<DEFANGED_OPTION selected=""Selected""
value="""">Choose....</DEFANGED_OPTION>
                                                
                                                                <%
 
Do Until rsOffice.EOF=True
                                                                %>
 
<DEFANGED_OPTION>
 
<%
 
=rsOffice.Fields("OfficeName").Value
 
%>
 
</DEFANGED_OPTION>
                                                                <%
 
rsOffice.MoveNext
 
Loop
                                                                %>
 
</DEFANGED_SELECT>
                                                <%
                                                
                                                response.write "<HR
WIDTH='100%'>"                                
                                                                
                                                response.write
request.form("ddOffices")
 
                                                rsOffice.Close
                                                Set rsOffice=Nothing
                                End If
                End If
                %>
                                </BODY>
                <%
 
                rsCheck.Close
                Set rsCheck=Nothing
                dbConn.Close
                Set dbConn=Nothing
%>
 
I get and Error for Line 3 saying Object Expected, but haven't a clue what
this could be.....I hope someone can point me in the right direction.
Basically when a user selects an option from the dropdown box I want to jump
to the function at the top of the page and then just print the office that
the user selected underneath the dropdown box.
 
Thanks in advance.
 
Paul Hartland

-- 

Whatever you Wanadoo:
http://www.wanadoo.co.uk/time/

This email has been checked for most known viruses - find out more at:
http://www.wanadoo.co.uk/help/id/7098.htm
--
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list