|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
link tracker
hi,
plz can any body help me editing it! it gives me error at RS.open strsql, Conn,2 ,2 : Data type mismatch in criteria expression. *the story is: i want when i request download.asp?id=1 it add 1 to TIMES field and redirect to URL field so i can know the hits of each link **the database field is: Id = Autonumber times = number 'how much hits of the ID url = text ================================================== ======= <% Response.Buffer=TRUE if request("ID")<>"" then Dim Conn Set Conn = Server.CreateObject("ADODB.Connection") Conn.ConnectionString = "FILEDSN=D:\My Documents\Desktop\website\ddl.dsn" Conn.open t_id=request("ID") strsql = "SELECT * FROM ddl where ID='"& t_id &"'" Set rs = Server.CreateObject("ADODB.RecordSet") RS.open strsql, Conn,2 ,2 if not rs.eof then rs("Times")=rs("Times")+1 rs.update rs.Close set rs=nothing Conn.Close else rs.Close 'i dont know what i will do in this line lol next line sqlString = "INSERT .................... Set RS=Conn.Execute(sqlString) Set RS=nothing end if response.redirect(&rs("URL")&) end if %> ================================================== ======= thanks for any help ![]() sorry for my bad english :-$ |
|
#2
|
|||
|
|||
|
Hi Samer,
How about using an update query, like this: UPDATE ddl SET Times = Times + 1 instead of the RS.Update and insert queries...? |
|
#3
|
|||
|
|||
|
hi, thanks for replay but i think there was another error too its
strsql = "SELECT * FROM ddl where ID='"& t_id &"'" to strsql = "SELECT * FROM ddl where ID=" t_id *t_id is number so its should be but in ". *i dont know how i will use insert stetment i tried soo many times and i got many error: Cannot update. Database or object is read-only. help me thanks. |
|
#4
|
|||
|
|||
|
its okay now
well forget it
all things is okay now . |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > link tracker |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|