|
 |
aspx_beginners thread: Hit Counts
Message #1 by "Steve White" <srw.ict@b...> on Wed, 20 Mar 2002 11:02:13
|
|
My database contains word and pdf formast documents. How can I implement
a method to calculate how many times each document has been viewed?
thx for any help
steve
Message #2 by "Steve White" <srw.ict@b...> on Wed, 20 Mar 2002 11:04:03
|
|
I neglected to mention that I'm using asp.net as the web front-end ;P ,
just in case u thought i was posting in the wrong forum
> My database contains word and pdf formast documents. How can I
implement
a> method to calculate how many times each document has been viewed?
> thx for any help
> steve
Message #3 by Imar Spaanjaars <Imar@S...> on Wed, 20 Mar 2002 18:14:52 +0100
|
|
What kind of database are you using?
If you are using SQL Server for instance, simply use a Stored Procedure
that retrieves the requested document. Right before you return the document
to the client, issue an UPDATE statement to increase the number of
"pageviews" for the current table.
Let me / us know if you need more info. If so, please specify your database.
Regards,
Imar
At 11:02 AM 3/20/2002 +0000, you wrote:
>My database contains word and pdf formast documents. How can I implement
>a method to calculate how many times each document has been viewed?
>
>thx for any help
>
>steve
Message #4 by "Cliff Schneide" <Cliff_Schneide@n...> on Wed, 20 Mar 2002 10:23:38 -0500
|
|
Hi,
Once you create the word object or other app...
Set oWord = CreateObject("Word.Application")
to put the file on the hard drive do this...
where sFileName(0) etc... is the file name
strData is from a stream reader of the file or data from the database or asp
page
Set FSO2 = CreateObject("Scripting.FileSystemObject")
Set ts = FSO2.CreateTextFile("C:\myfolder\" & sFileName(loopcounter), True)
ts.Write Trim(strData)
ts.Close
where sReportFile(0) etc is the file path/name
put a counter around when you open the word object
oWord.Documents.Open sReportFile(loopcounter), False, True, False, "", "",
False, "", "", wdOpenFormatAuto
That should give you an idea of how you can do it...
Cliff Schneide
Web Developer
Computer Aid Inc.
|
|
 |