Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 error date..................?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

khalid
New Member

Saudi Arabia
51 Posts

Posted - 06 November 2001 :  00:05:34  Show Profile
hi all



Microsoft VBScript runtime error '800a000d'

Type mismatch: '[string: "07/10/2001 01:54:00 "]'

/mypage/links/search.asp, line 119



----------------------------the code-------------------------------

<%@Language="VbScript" CodePage="1256"%>
<!-- #INCLUDE FILE="adovbs.inc" -->
<html dir=rtl>>

<head>

</head>
<%

search = trim(Request("search"))
show = Request("num")
xxx = Request("xxx")
%>
<body topmargin="0" leftmargin="0">
<br>
<center><font face="Tahoma" size="3">ÃäÊ ÊÈÍË ÚÜä :</font> <font face="Tahoma" size="3" color="#FF0000"> <%=search%></font></center>
<br>

<%
select case xxx
case "1"
sqlq = "select * from link2 where keyword like '%" & search & "%' or description like '%" & seaRCH & "%' order by name"

case "2"
aryKeywords = Split(search, " ")

sqlq = "select * from link2 where"
For i = 0 To UBound(aryKeywords)
SQLQ = SQLQ & tempJoinWord & "(" & _
"keyword LIKE '%" & aryKeywords(i) & "%' OR " & _
"description LIKE '%" & aryKeywords(i) & "%')"
tempJoinWord = " OR "
Next

sqlq = sqlq & "order by Name"

end select

CONN_STRING = "DBQ=" & Server.MapPath("/mypage/db/link.mdb") & ";"
CONN_STRING = CONN_STRING & "Driver={Microsoft Access Driver (*.mdb)};"
'buil string for connection my database file is link.mdb in store in the same folder of this file.

Dim iPageSize
Dim iPageCount
Dim iPageCurrent
Dim strOrderBy
Dim strSQL
Dim objPagingConn
Dim objPagingRS
Dim iRecordsShown
Dim I


select case show
case 10
iPageSize = 10
case 20
iPageSize = 20
case 30
iPageSize = 30

end select
'set page size

If Request.QueryString("page") = "" Then
iPageCurrent = 1
Else
iPageCurrent = CInt(Request.QueryString("page"))
End If

If Request.QueryString("order") = "" Then
strOrderBy = "id"
Else
strOrderBy = Request.QueryString("order")
End If



' select sql from the table..my table in link.mdb name "link2"

Set objPagingConn = Server.CreateObject("ADODB.Connection")
objPagingConn.Open CONN_STRING
'open connection

Set objPagingRS = Server.CreateObject("ADODB.Recordset")
objPagingRS.PageSize = iPageSize
objPagingRS.CacheSize = iPageSize
objPagingRS.Open sqlq, objPagingConn, adOpenStatic, adLockReadOnly, adCmdText


reccount = objPagingRS.recordcount
iPageCount = objPagingRS.PageCount

If iPageCurrent > iPageCount Then iPageCurrent = iPageCount
If iPageCurrent < 1 Then iPageCurrent = 1

If iPageCount = 0 Then
Response.Write "<center><font color=red size=3>No records found!</font></center>"
Else
objPagingRS.AbsolutePage = iPageCurrent

%>
<center>
<font face="Tahoma" size="2" color="#FF0000">æÌÜÏ (<%=reccount%>) ãÜæÞÜÚ</font>


<BR><BR>

<%

sss = (iPageSize * iPageCurrent) - iPageSize
iRecordsShown = 0
Do While iRecordsShown < iPageSize And Not objPagingRS.EOF


pluscount = pluscount+1


error--------> dagar=DateDiff("d", Date, objPagingRS("postDate"))+7

if dagar >= 0 then
%>


<center>
<table border=0 width=500 cellspacing=0 bordercolor=A8C5FF>
<tr><td bgcolor="#Ffffff" width="400">
<font size=2 Face=Tahoma > <%=sss+pluscount%> . </font> <a href="goto.asp?id=<%=objPagingRS("ID")%>" target="_blank"><font size=2 Face=Tahoma ><%=objPagingRS("Name")%></font></a>  <img src="new.gif" border=0>
</td><td bgcolor="#Ffffff" width="100"><font face="Tahoma" size=2 color='red'>ãÑÇÊ ÇáØáÈ : <%=objPagingRS("Hit")%> </font></td>
</tr>
<tr>
<td colspan='2' bgcolor="#F5F5F5"><font size=2 Face=Tahoma ><%=objPagingRS("Description")%> </font></td>
</tr>
<tr>
<td colspan='2' > <font size=1 Face=Tahoma color="008800"><%=objPagingRS("postdate")%> </font><font face="Tahoma" size="1"><font color="#FF9900"> |</font>
<a href="error.asp?id=<%=objPagingRS("ID")%>"> ÇáæÕáÉ ÎØÃ</a></font></td>
</tr>
</table>
</center><br>
<%else
%>
<center>
<table border=0 width=500 cellspacing=0 bordercolor=A8C5FF>
<tr><td bgcolor="#Ffffff" width="400">
<font size=2 Face=Tahoma > <%=sss+pluscount%> . </font> <a href="goto.asp?id=<%=objPagingRS("ID")%>" target="_blank"><font size=2 Face=Tahoma ><%=objPagingRS("Name")%></font></a>
</td><td bgcolor="#Ffffff" width="100"><font face="Tahoma" size=2 color='red'>ãÑÇÊ ÇáØáÈ : <%=objPagingRS("Hit")%> </font></td>
</tr>
<tr>
<td colspan='2' bgcolor="#F5F5F5"><font size=2 Face=Tahoma ><%=objPagingRS("Description")%> </font></td>
</tr>
<tr>
<td colspan='2' > <font size=1 Face=Tahoma color="008800"><%=objPagingRS("postdate")%> </font><font face="Tahoma" size="1"><font color="#FF9900"> |</font>
<a href="error.asp?id=<%=objPagingRS("ID")%>"> ÇáæÕáÉ ÎØÃ</a></font></td>
</tr>
</table>
</center><br>

<%
end if

iRecordsShown = iRecordsShown + 1
objPagingRS.MoveNext
Loop
%>


<%
End If

objPagingRS.Close
Set objPagingRS = Nothing
objPagingConn.Close
Set objPagingConn = Nothing


If iPageCurrent <> 1 Then
%>

<A HREF="./search.asp?page=<%= iPageCurrent - 1 %>&order=<%= Server.URLEncode(strOrderBy) %>&search=<%=search%>&num=<%=show%>&xxx=<%=xxx%>"><font face="Tahoma" size="2"><--ÇáÓÇÈÞ</font></A>
   <%
End If

If iPageCurrent < iPageCount Then
%>
<A HREF="./search.asp?page=<%= iPageCurrent + 1 %>&order=<%= Server.URLEncode(strOrderBy) %>&search=<%=search%>&num=<%=show%>&xxx=<%=xxx%>"><font face="Tahoma" size="2">ÇáÊÇáí--></font></A>
</center>
<%
End If


%>
<center>
<font face="Tahoma" size="2">ÕÝÍÉ <%= iPageCurrent %> ãä</font>
<FONT SIZE="1">
<%= iPageCount %>
</FONT>
</center>
<br>
<center><font face="Tahoma" size="2"><!--#include file="eze.inc"--></font></center>
</body>

</html>


paco
Junior Member

Spain
187 Posts

Posted - 06 November 2001 :  09:21:11  Show Profile
Could you mark which is line 119 so we can better spot the problem? I don't want to start counting or read all the code.

Thanks,

Paco

Go to Top of Page

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 06 November 2001 :  09:34:24  Show Profile  Visit Kat's Homepage
dagar=DateDiff("d", Date, objPagingRS("postDate"))+7


should be

dagar=DateDiff("d", Date, objPagingRS("postDate"))
dagar = dagar + 7


i think.

KatsKorner


Edited by - kat on 06 November 2001 09:36:37
Go to Top of Page

khalid
New Member

Saudi Arabia
51 Posts

Posted - 07 November 2001 :  08:54:48  Show Profile
:(
No Kat
same error.....................
:(

Go to Top of Page

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 07 November 2001 :  09:02:27  Show Profile  Visit Kat's Homepage
can you post the 2 dates that you are trying to use in the DateDiff function? (the actual values not the variables).

I suspect that these 2 dates are not in the same format to be able to compare them?

KatsKorner


Edited by - kat on 07 November 2001 09:04:23
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.33 seconds. Powered By: Snitz Forums 2000 Version 3.4.07