<%@ LANGUAGE="VBSCRIPT" %> <% Option Explicit '--------------- ORGANISATION INFORMATION WEBSITE ---------------- ' File Name: ClubAddNewOracle.asp ' ' Purpose: ' Adds new Organisation Information ' ' Arguments: ' Comments ' ' Author: Gurpreet Khaira ' DBC IT Delivery ' Date Created: ' 27/04/2007 ' ' Modification History: ' '---------------------------------------------------------------------- '---------------------------------------------------------------------- ' ASP preprocessing code '---------------------------------------------------------------------- ' -- Declare Variables Dim strOrgtype, strOrgName, strOrgAddr1, strOrgAddr2, strOrgAddr3, strOrgPostcode Dim strOrgTelNo, strOrgFaxNo, strOrgWebsite, strConName, strConPosition, strConAddr1, strConAddr2, strConAddr3, strConAddr4 Dim strConPostcode, strConTelNoDay, strConTelNoEve, strConEmail, intDisabled, intContact, strAddInfo Dim NewOrganisationID dim validation dim header ' -- Get the list of organisations from the database. Dim strOrgtypesList 'String to hold the organisations list strOrgtypesList = GetOrganisationsListForComboBox () '---------------------------------------------------------------------- ' ASP post processing code and sub routines and functions '---------------------------------------------------------------------- ' -- Declare Variables Dim objConn2 ' Connection Object Dim objRS2 ' Recordset Object Dim strSQL ' SQL String to access the database Dim strConnection2 ' Connection string to access the database Dim i ' counter variable Dim RecordCount2 ' counter variable Dim RecordNum ' counter variable Dim strWhereOrgname ' Where clause for Area Dim strWhereStreet ' Where clause for Street Dim strFilter ' Our Filter String for Display Const adOpenKeyset = 1 'Constants used in Recordset operations Const adLockOptimistic = 3 ' -- Create objects Set objConn2 = Server.CreateObject("ADODB.Connection") Set objRS2 = Server.CreateObject("ADODB.Recordset") ' -- Connection String Value strConnection2 = "dsn=Cconnects;uid=cconnects;pwd=cconnects;" ' -- Open the Connection objConn2.Open strConnection2 ' -- Populate the Recordset Set objRS2.ActiveConnection = objConn2 strSQL = "SELECT * FROM CCONNECTS" objRS2.CursorType = adOpenKeyset objRS2.LockType = adLockOptimistic objRS2.Open strSQL, strConnection2 '---------------------------------------------------------------------- ' Begin HTML output '---------------------------------------------------------------------- %> Add New Organisation

Community Connects - Add new Organisation

<% ' -- Now loop to find the last Recordset objRS2.MoveFirst RecordCount2 = request.form("RecordCount") RecordNum = objRS2.Fields(0) DO Until objRS2.EOF 'RecordNum = RecordNum + 1 ' -- move to the next record NewOrganisationID = objRS2.Fields(0) + 1 objRS2.MoveNext 'old vbscript entry
Loop %>
Enter organisation details:











Enter contact person's details:










Copyright © 2007 Dartford Borough Council If only all councils were like Dartford
<% '---------------------------------------------------------------------- ' End HTML Output '---------------------------------------------------------------------- '---------------------------------------------------------------------- ' Function : GetOrganisationsListForComboBox ' Gets a list of organisations from the database '---------------------------------------------------------------------- Function GetOrganisationsListForComboBox() ' -- Declare Variables Dim objConn ' Connection Object Dim objRS ' Recordset Object Dim strSQL ' SQL String to access the database Dim strConnection ' Connection string to access the database Dim i ' counter variable Dim strResult ' Function Return Value ' -- Do we have the value in our Application Object already? 'strResult = Application("OrganisationsList") 'If strResult = "" Then ' -- No, so get it from the database -- removed because the combo was not working with this ' -- Create objects Set objConn = Server.CreateObject("ADODB.Connection") Set objRS = Server.CreateObject("ADODB.Recordset") ' -- Connection String Value strConnection = "dsn=Cconnects;uid=cconnects;pwd=cconnects;" ' -- Open the Connection objConn.Open strConnection ' -- Populate our Recordset with data strSQL = "SELECT DISTINCT CLASSID FROM CCONNECTS" set objRS = objConn.Execute (strSQL) if (objRS.BOF and objRS.EOF) then response.write "Sorry: No Records Found." response.end End if ' -- Start building the result string strResult = "" Do While Not objRS.EOF strResult = strResult & _ "" objRS.MoveNext Loop ' -- Close objects objRS.Close set objRS = Nothing objConn.Close set objConn = Nothing ' -- Store the value in the Application object for next visit Application.Lock Application("OrganisationsList") = strResult Application.UnLock 'End If -- endif bit of if statement above, removed because the combo was not working with this ' -- return the value GetOrganisationsListForComboBox = strResult End Function %>