I have a fairly simple site I'm working on at the moment. There's a demo available if anyone wants to go and see it in action, it's at
http://www.orangestar.net/organiseruser: guest
login: guest
Comments on appearance & usability would be welcome!
(bear in mind that this is on a UK server so the Americans amongst you will find the dates appearing to look strange)
For what I thought was simplicity's sake, I decided to have most of the scripting in one include file (with a .asp extension to stop unauthorised downloads) and this has ended up being 35KB in size. This file is included in virtually every file in the site (about 35 pages) and I'm wondering if it's impacting performance.
For example's sake, I've included below one of the functions from the big include file so you can see my file access method. This may be utterly awful coding - sorry - I'm self-taught and I don't know any other way!
--- code starts ---
Function InsertKeyDate(inUserID, inEventDate, inEventDesc, inKeyDate)
Dim DSNtemp, rstemp, conntemp
DoubleQuote=Cstr(Chr(34))
StrQuote=Chr(34)
DSNtemp="DRIVER={Microsoft
Access Driver (*.mdb)}; "
DSNtemp=dsntemp & "DBQ=" & server.mappath(Session("Da
tabasePath
"))
'-- Create object and open database
Set rstemp = Server.CreateObject("ADODB
.Recordset
")
Set conntemp = Server.CreateObject("ADODB
.connectio
n")
conntemp.Open DSNtemp
rstemp.open "Diary",conntemp,3,3
rstemp.addnew
rstemp("UserID")=inUserID
rstemp("EventDate")=format
datetime(i
nEventDate
,2)
inEventDesc=replace(inEven
tDesc, strQuote, "'")
rstemp("EventDesc")=replac
e(inEventD
esc,"'","'
'")
rstemp("KeyDate")=inKeyDat
e
rstemp.update
rstemp.close
set rstemp=nothing
conntemp.close
set conntemp=nothing
End Function
----- code ends ----
This code is pretty much repeated for updates and deletes, and exists for all of the 4 'sections' of the online organiser, so you can see how the file has got to be so big. Is it the size of this file being included in all of the pages that's making the site slow (the server it's on is quick) or is it the clumsiness in coding? The background images of the 'book' are all the same, so once loaded should be quick.
I'd appreciate some input on this and I'll give points to those who can help me the most. Clockwatcher, Robbert, TTom, et al... - right up your street?