paul.hartland at fsmail.net
paul.hartland at fsmail.net
Thu May 20 04:24:14 CDT 2004
To all, Firstly can anyone suggest a good asp list thats as excellent as this one ?. Secondly is there anyone that can tell me what Im 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>" %> <SELECT name='ddOffices' onchange='OfficeSelected()'> <OPTION selected=""Selected"" value="""">Choose....</OPTION> <% Do Until rsOffice.EOF=True %> <OPTION> <% =rsOffice.Fields("OfficeName").Value %> </OPTION> <% rsOffice.MoveNext Loop %> </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 havent 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