MartyConnelly
martyconnelly at shaw.ca
Thu May 20 15:55:49 CDT 2004
A good help mailist or blogs at communities http://www.aspadvice.com If you have ASP on your machine, you have the adovbs.inc file somewhere on your machine. Do a search for it. adovbs.inc is a text file containing ASP scripting that provides constant string values for a whole slew of ADO properties. For example, if you don't use ADO, you can open a fully-navigable RecordSet by specifying the CursorType property thusly: RecordSetName.CursorType = 3 If using adovbs.inc, you can use: RecordSetName.CursorType = adOpenStatic --- You can store adovbs.inc anywhere. I use similar includes in an /includes/ folder off the root: /includes/ Then reference it this way: <!--#include virtual="/includes/adovbs.inc"--> or directly off your root include the following <!-- #include file="../adovbs.inc" --> To really speed things up you can put the following inside the file global.asa: and avoid putting all this 10 K script from adovbs.inc in every page. You will need access to IIS to do this <!--METADATA TYPE="TypeLib" FILE="c:\program files\common files\system\ado\msado15.dll" NAME="ADO type library" --> ranthony at wrsystems.com wrote: >I'm not sure what this line does, <!--#Include Virtual="/ADOVBS.inc"-->. >When I use the include statement, I use it with a file and the path to that >file. For instance, ><!--#INCLUDE FILE="../wplog/DBconnect.inc" --> > >-----Original Message----- >From: paul.hartland at fsmail.net [mailto:paul.hartland at fsmail.net] >Sent: Thursday, May 20, 2004 5: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>" > > %> > <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 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 > > > -- Marty Connelly Victoria, B.C. Canada