webForumDet fria alternativet

Inkompatibla typer

3 svar · 334 visningar · startad av calson

calsonMedlem sedan dec. 2003487 inlägg
#1

Jag får felmedelandet

Feltyp:
Körningsfel i Microsoft VBScript (0x800A000D)
Inkompatibla typer
/v2.0/gastbok.asp, line 266

Jag har kört detta skriptet innan som då fungerat men jag måste gjort något konstigt eftersom det inte fungerar nu?

Line 266 är

Call buttonNavigate(intPage, intTotalPosts, intPostsPerPage, intPages)
Public Sub buttonNavigate(intPage, intTotalPosts, intPostsPerPage, intPages)

	'// Navigering - Första/Bakåt
	If intPage > 1 Then
		Response.Write ""& vbcrlf &_
		"	<button onclick=""parent.main.location.href='main.asp?page=" & request.querystring("page") & "&Fpage=';"" title="" Första "" class=""navBtn"">&nbsp;<<<&nbsp;</button>"& vbcrlf
	Else
		response.write "	<button disabled=""disabled"" class=""navBtn"">&nbsp;<<<&nbsp;</button>"& vbcrlf
	End If

	If intPage > 10 Then
		Response.write "	<button onclick=""parent.main.location.href='main.asp?page=" & request.querystring("page") & "&Fpage="& intPage - 10 &"';"" title="" Backa10 "" class=""navBtn"">&nbsp;<<&nbsp;</button>"& vbcrlf & vbcrlf
	Else
		response.write "	<button disabled=""disabled"" class=""navBtn"">&nbsp;<<&nbsp;</button>"& vbcrlf
	End If

	If intPage > 1 Then
		Response.write "	<button onclick=""parent.main.location.href='main.asp?page=" & request.querystring("page") & "&Fpage="& intPage - 1 &"';"" title="" Backa "" class=""navBtn"">&nbsp;<&nbsp;</button>"& vbcrlf & vbcrlf
	Else 
		response.write "	<button disabled=""disabled"" class=""navBtn"">&nbsp;<&nbsp;</button>"& vbcrlf & vbcrlf
	End If

Tack på förhand

@ndersMedlem sedan juni 200032 969 inlägg
#2

Vad innehåller variablerna intPage, intTotalPosts, intPostsPerPage och intPages när du kallar på subrutinen då?

calsonMedlem sedan dec. 2003487 inlägg
#3
intPageSize = 10
intPage = request.querystring("Fpage")

if intPage = "" then intPage = 1
  strSql = "Select Count(*) As intAntal from tblGb"
  set objRs = objConr.execute(strSql)

    intAntal = objRs("intAntal")
	'// Poster per sida
	intPostsPerPage = 10

	'// Navigeringshantering
	If Len(trim(Request.Querystring("Fpage"))) > 0 Then intPage = cInt(trim(Request.Querystring("Fpage"))) Else intPage = 1
	intFirstPost = (intPage - 1) * intPostsPerPage
	intTotalPosts = intAntal
	intPages = ((intTotalPosts)\intPostsPerPage)-1

	If intFirstPost + (intPostsPerPage - 1) >= intAntal Then
		intLastPost = intAntal
	Else
		intLastPost = intFirstPost + (intPostsPerPage - 1)
		strNext = True
	End If
doggelitoMedlem sedan juni 20003 076 inlägg
#4

testa att skriva ut värdena så du vet säkert att du får in dem korrekt i subben.

Response.Write(intPage & "|" & intTotalPosts & "|" & intPostsPerPage & "|" & intPages)
'Call buttonNavigate(intPage, intTotalPosts, intPostsPerPage, intPages)
264 ms totalt · 3 externa anrop · v20260731065814-full.86db40fa
0 ms — hämta forumlista (cache)
129 ms — hämta statistik (db)
133 ms — hämta tråd, inlägg och bilagor (db)