|
 |
asp_databases thread: SV: Re: Count with database...
Message #1 by "SD-Studios" <info@s...> on Mon, 24 Sep 2001 11:30:12 +0200
|
|
I know there I get a record by my search, but the problem is that is doesnt
update the field.. No errors generated. I just want the current number in
the field, and when ive got that, I want it to add 1 and then update. =)
--
Martin Johansson
-----Ursprungligt meddelande-----
Från: Ken Schaefer [mailto:ken@a...]
Skickat: den 24 september 2001 07:56
Till: ASP Databases
Ämne: [asp_databases] Re: Count with database...
Why doesn't it work? Does it generate an error? Does it update the field?
Are you sure there are any records returned by your search? etc etc. Please
explain what the problem is.
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
----- Original Message -----
From: "SD-Studios" <info@s...>
To: "ASP Databases" <asp_databases@p...>
Sent: Monday, September 24, 2001 7:42 AM
Subject: [asp_databases] Count with database...
: Hi!
: Got no answer, I've still got this problem with a page that is suppose to
: count downloads. I use
: this code:
:
: <%
: Function RetrieveAndIncrementCount()
:
: Const adOpenKeyset = 1
: Const adLockPessimistic = 2
: Const adCmdText = &H0001
:
: Set rsCounter = Server.CreateObject("ADODB.Recordset")
: Set objCon = Server.CreateObject("ADODB.Connection")
:
: objCon.Open "Driver={Microsoft Access Driver (*.mdb)};dbq=" &
: Server.MapPath("database.mdb")
: SQL = "SELECT downloads FROM games WHERE gametitle='" &
: Request.QueryString("game") & "';"
:
: rsCounter.Open SQL, objCon, adOpenKeyset, adLockPessimistic, adCmdText
:
: iCount = rsCounter("downloads")
:
: rsCounter.Fields("downloads") = iCount + 1
: rsCounter.Update
:
: rsCounter.Close
: objCon.Close
:
: End Function
: %>
:
: Togehter with this I as u can see use an Access-database. The field
: downloads is set as Integer. But this doesn't count! Can someone please
help
: me? =)
: --
: Martin Johansson
Message #2 by "Ken Schaefer" <ken@a...> on Tue, 25 Sep 2001 12:00:10 +1000
|
|
Hi,
So iCount always has a value, but no update is occuring?
Do you have On Error Resume Next anywhere in your code? If so, comment it
out.
Also, why are you using a function if you are not returning any value?
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
----- Original Message -----
From: "SD-Studios" <info@s...>
To: "ASP Databases" <asp_databases@p...>
Sent: Monday, September 24, 2001 7:30 PM
Subject: [asp_databases] SV: Re: Count with database...
: I know there I get a record by my search, but the problem is that is
doesnt
: update the field.. No errors generated. I just want the current number in
: the field, and when ive got that, I want it to add 1 and then update. =)
: --
: Martin Johansson
:
:
: -----Ursprungligt meddelande-----
: Från: Ken Schaefer [mailto:ken@a...]
: Skickat: den 24 september 2001 07:56
: Till: ASP Databases
: Ämne: [asp_databases] Re: Count with database...
:
:
: Why doesn't it work? Does it generate an error? Does it update the field?
: Are you sure there are any records returned by your search? etc etc.
Please
: explain what the problem is.
:
: Cheers
: Ken
|
|
 |