Hi,

I'm still no further to solving this:
Let me outline the problem again.....

I have a frameset page which contains two horizontal frames
Oh and i have a splash page

Splash = default.asp
frameset page = drzedsoultions.asp
menu frame = drzedbanner.asp
main viewing = homepage.asp

I use a shortcut to the frameset page so that if everything is right, the frameset should redirect to the splash page if its not been shown

if it has been shown then log the page in the database and then continue loading the document.

As this is a frameset page it wishes to load the source documents for the frames themselves, so:

It loads the menu frame which checks to see if the splash page is shown, if not redirect to splash page otherwise log the hit in the database, and load the page

It then loads the main viewing frame which checks to see if the splash page is shown, if not redirect to splash page otherwise log the hit in the database, and load the page


And what happens is that the pages load okay WITHOUT any ERRORS BUT.....
The frameset page logs the hit okay (1 as its only been loaded once) BUT both the two frames pages have an extra hit each (2 each even thoug they are loaded for first time and have not redirected anywhere)......

So I'm completely baffled:

I've posted bits of the code below, can anyone help me out please?


The following code is what I use to Call the procdure to log the hit:

Code:
Dim strThisPage
'Dim lngCounta

	'--> Init Page Name
	strThisPage = Request.ServerVariables("SCRIPT_NAME")
	
	'--> Splashed ?	
	if Splashed() <> "True" Then response.redirect "default.asp"

	'--> Cookies Enabled ?
	if CookiesEnabled() <> "True" Then response.redirect "nocookies.asp"
			
	'--> hit page
	HitPage strThisPage

	'--> tidy up
	Set strThisPage = Nothing
	'Set lngCounta = nothing


Everything looks right there.....

This is my psuedo code for hit logging,
Code:
'----------------------------------------------------------------------------------------------
'-->	Tally A Hit For The Document Named sPage
'-------------------------------------------------------------------------------------------------
' Name:     HitPage(sPage)
' Type:     Procedure
' Purpose:  To log a hit on the page within the dr zed solutions database
' Inputs:   sPage:- The page whose hit requires logging
' Returns:  none
' Calls:    DoesEntryExist(sPage)
'           IncreaseHitCounter(sPage, xPageNumber)
'           AddNewEntry(sPage)
' Psuedo:   if entry exists
'              get old hits
'              increase hits by 1
'           else
'              if in domain
'                 add new entry
'              else
'                 ERROR
'              end if
'           end if
'-------------------------------------------------------------------------------------------------

Ok and this is the routine i use to ADD A NEW ENTRY

Code:
'----------------------------------------------------------------------------------------------
'-->	Add A New Entry For Page sPage In The PAGEHITS Table
'-------------------------------------------------------------------------------------------------
' Name:     AddNewEntry(sPage)
' Type:     Procedure
' Purpose:  Add a new record entry for the specified page to the dr zed solutions database
' Inputs:   sPage:- The page whose entry needs to be added
' Returns:  None
' Calls:    None
'-------------------------------------------------------------------------------------------------
Public Sub AddNewEntry(sPage)

Dim anBookmark, anConn, anRs

	'init objects
	set anConn = Server.CreateObject("ADODB.Connection")
	set anRs = Server.CreateObject("ADODB.Recordset")	

	anConn.Open "DBQ=" & Server.Mappath("_private/drzedsolutions.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"

	'Access does not support a cursor engine so a client cursor must be used
	anRS.CursorLocation = adUseClient
	
	anRS.Open "SELECT * FROM PageHits", anConn, adOpenStatic, adLockOptimistic

	'add new record
	anRs.AddNew
		'set values - dont set anRs("db_index") as its autonumber primary key
		anRs("db_url")=sPage
		anRs("db_hits")=1
		anRs("db_rating")=0
	'update to save it
	anRs.update

	anBookmark = anRs.absolutePosition  
	anRs.Requery                      	
	anRs.absolutePosition = anBookmark  

	'tidy up
	set anConn=nothing
	set anRs=nothing	
	set anBookmark=nothing
	
End Sub
'----------------------------------------------------------------------------------------------

And there you have it.

I use the same routines in each page copied and pasted, and have gone through the code line by line and its same exactly.

Its driving me nuts....
So to recap:
bot the splash page and frameset page get 1 hit each thats correct and okay-amundo

BUT the two douments inside the frameset page get 2 hits each instead of 1

DocZaf
{;->