PDA

View Full Version : Database counters


canudo
03-28-2003, 09:52 AM
Hello ppl...

Im trying to create a hit couter with a Database... in asp

I the Db, and the Asp but it doesn't work, it's like it wont reach the DB and Error XPTO etc...

Can anyone help do this???

Thanks
CaNuDo:D

glenngv
03-28-2003, 10:06 AM
you didn't provide enough details that will help us solve your problem.

Mhtml
03-28-2003, 12:11 PM
<%
DbLocation = "db/counter.mdb" '**Database location**'

set conn = server.createObject("adodb.connection")
set rs = server.createobject("adodb.recordset")
conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; Dbq="&server.MapPath(DbLocation)&";"

sqlIncrement = "Update Counter SET Count + 1"
rs.Open sqlIncrement, conn

Set rs = nothing
conn.close
set conn = nothing
%>


Very primative but functional.

canudo
03-31-2003, 08:37 AM
Ok, i'll try to be more specific!

I have the Db, an asp page wich calls the db and the index.asp..

I place the <!--include thing--!> in the index but i still havent got any results and i really have to create an hit counter.

It sound very easy to create but still im having a lot of prolems doing it..

Thanks,
CaNuDo:D :thumbsup:

Mhtml
03-31-2003, 09:19 AM
you didn't provide enough details that will help us solve your problem.

:rolleyes:

Can you please show us the code?

arnyinc
03-31-2003, 05:32 PM
It is either a problem with how you are creating the objects, connecting to the database, setting up your SQL statement, executing your SQL statement, or the permissions on your database (if it's an Access db). Or it could be something else depending on how you wrote the hit counter.

canudo
03-31-2003, 06:43 PM
Hi again,

This is what i had on the DataBase file: *.mdb

hits - number
counter - yes/no

that's all i can remember of the code...

About the rest i belive it was working.. probably just something wrong:(

:D