Hi members please help iam getting this above error message please help.
Error Type:
Microsoft VBScript compilation (0x800A03FC)
Expected 'Next'
/catalogue/DaEngine24.asp, line 91
2.
how can i improve this code to make the colums displayed to automatically change depending on the length of the data in them
<% Option Explicit %>
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<%
Dim Conn,strSQL,objRec,strKeyword,chkDel
Set Conn = Server.Createobject("ADODB.Connection")
Conn.Open "Driver={SQL Server};Server=kcc2;Database=Slis;UID=sula;PWD=sul a;"
For Each chkDel in Request.Form("chkDel")
strSQL = "select * FROM books WHERE autono = "& chkDel
Set objRec = Server.CreateObject("ADODB.RecordSet")
objRec.open strsql, Conn
'Response.write(strSQL)
' Response.end()
objRec.Open strSQL, Conn
If objRec.EOF Then
Response.write (" Not found record.")
Else
Dim PageLen,PageNo,TotalRecord,TotalPage,No,intID
PageLen = 2
PageNo = Request.QueryString("Page")
if PageNo = "" Then PageNo = 1
TotalRecord = objRec.RecordCount
objRec.PageSize = PageLen
TotalPage = objRec.PageCount
objRec.AbsolutePage = PageNo
%>
<table width="600" border="1">
<tr>
<th width="91"> <div align="center">Title </div></th>
<th width="98"> <div align="center">callno </div></th>
<th width="198"> <div align="center">author </div></th>
<th width="97"> <div align="center">Category </div></th>
<th width="59"> <div align="center">classe </div></th>
<th width="71"> <div align="center">subjectcode </div></th>
<th width="30"> <div align="center">Tick </div></th>
</tr>
<%
No=1
Do While Not objRec.EOF and No <= PageLen
%>
<tr>
<td><div align="center"><%=objRec.Fields("Title").Value%></div></td>
<td><%=objRec.Fields("callno").Value%></td>
<td><%=objRec.Fields("author").Value%></td>
<td><div align="center"><%=objRec.Fields("Category").Value%></div></td>
<td align="right"><%=objRec.Fields("classe").Value%></td>
<td align="right"><%=objRec.Fields("subjectcode").Value%></td>
<td align="center"><input type="checkbox" name="chkDel" value="<%=objRec.Fields("autono").Value%>"></td>
</tr>
<%
No = No + 1
objRec.MoveNext
Loop
%>
</table>
Total : <%=TotalRecord%> Records. Page <%=PageNo%> (All Page <%=TotalPage%>)
<% IF Cint(PageNo) > 1 then %>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?Page=1"><< First</a>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?Page=<%=PageNo-1%>">< Back</a>
<% End IF%>
<% IF Cint(PageNo) < TotalPage Then %>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?Page=<%=PageNo+1%>">Next ></a>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?Page=<%=TotalPage%>">Last >></a>
<% End IF%>
<br>
Go to
<% For intID = 1 To TotalPage%>
<% if intID = Cint(PageNo) Then%>
<b><%=intID%></b>
<%Else%>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?Page=<%=intID%>"><%=intID%></a>
<%End IF%>
<%Next%>
<%
objRec.Close()
Conn.Close()
Set objRec = Nothing
Set Conn = Nothing
end if
%>
</body>
</html>
Error Type:
Microsoft VBScript compilation (0x800A03FC)
Expected 'Next'
/catalogue/DaEngine24.asp, line 91
2.
how can i improve this code to make the colums displayed to automatically change depending on the length of the data in them
<% Option Explicit %>
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<%
Dim Conn,strSQL,objRec,strKeyword,chkDel
Set Conn = Server.Createobject("ADODB.Connection")
Conn.Open "Driver={SQL Server};Server=kcc2;Database=Slis;UID=sula;PWD=sul a;"
For Each chkDel in Request.Form("chkDel")
strSQL = "select * FROM books WHERE autono = "& chkDel
Set objRec = Server.CreateObject("ADODB.RecordSet")
objRec.open strsql, Conn
'Response.write(strSQL)
' Response.end()
objRec.Open strSQL, Conn
If objRec.EOF Then
Response.write (" Not found record.")
Else
Dim PageLen,PageNo,TotalRecord,TotalPage,No,intID
PageLen = 2
PageNo = Request.QueryString("Page")
if PageNo = "" Then PageNo = 1
TotalRecord = objRec.RecordCount
objRec.PageSize = PageLen
TotalPage = objRec.PageCount
objRec.AbsolutePage = PageNo
%>
<table width="600" border="1">
<tr>
<th width="91"> <div align="center">Title </div></th>
<th width="98"> <div align="center">callno </div></th>
<th width="198"> <div align="center">author </div></th>
<th width="97"> <div align="center">Category </div></th>
<th width="59"> <div align="center">classe </div></th>
<th width="71"> <div align="center">subjectcode </div></th>
<th width="30"> <div align="center">Tick </div></th>
</tr>
<%
No=1
Do While Not objRec.EOF and No <= PageLen
%>
<tr>
<td><div align="center"><%=objRec.Fields("Title").Value%></div></td>
<td><%=objRec.Fields("callno").Value%></td>
<td><%=objRec.Fields("author").Value%></td>
<td><div align="center"><%=objRec.Fields("Category").Value%></div></td>
<td align="right"><%=objRec.Fields("classe").Value%></td>
<td align="right"><%=objRec.Fields("subjectcode").Value%></td>
<td align="center"><input type="checkbox" name="chkDel" value="<%=objRec.Fields("autono").Value%>"></td>
</tr>
<%
No = No + 1
objRec.MoveNext
Loop
%>
</table>
Total : <%=TotalRecord%> Records. Page <%=PageNo%> (All Page <%=TotalPage%>)
<% IF Cint(PageNo) > 1 then %>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?Page=1"><< First</a>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?Page=<%=PageNo-1%>">< Back</a>
<% End IF%>
<% IF Cint(PageNo) < TotalPage Then %>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?Page=<%=PageNo+1%>">Next ></a>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?Page=<%=TotalPage%>">Last >></a>
<% End IF%>
<br>
Go to
<% For intID = 1 To TotalPage%>
<% if intID = Cint(PageNo) Then%>
<b><%=intID%></b>
<%Else%>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?Page=<%=intID%>"><%=intID%></a>
<%End IF%>
<%Next%>
<%
objRec.Close()
Conn.Close()
Set objRec = Nothing
Set Conn = Nothing
end if
%>
</body>
</html>