通常人们使用以下两种方法来执行SQL语句:
Set Rs=Conn.Execute(SqlStr)
和
Set Rs=Server.CreateObject(“ADODB.RecordSet“)
Rs.Open SqlStr,Conn,CursorType,LockType
(RecordSet对象方法请看这里)
由于默认的记录集游标是服务器游标,
Rs.CursorLocation = adUseServer
所以返回Rs.RecordCount=-1,
应该把服务器游标改为客户端游标,
Rs.CursorLocation = adUseClient
Rs.Open SqlStr,Conn,CursorType,LockType
rs.cursortype
光标类型 recordcount 属性
相关推荐
分页存储过程.SQL,@tblName ... @page int = 1, ----要显示那一页的记录 @fldSort nvarchar(max) = null, ----排序字段列表 @strCondition nvarchar(max), ----条件字段 @recordCount bigint output
set @pagecount = @recordcount / @PageSize + 1 if @lastcount = 0 or @pageindex begin set @sql = N'select ' + @strGetFields + N' from (select top ' + convert(nvarchar(4),@PageSize) + N' * from ...
winform 的一个前台 分页控件,项目用了devExpress控件组。 你也可以不用,用普通的按钮,输入框代替,后台代码都是基本一样。 用法,工具箱,选择项,浏览,选 xpager.dll...this.xPager1.RecordCount = recordcount ;
else StatusBar1->Panels->Items[1]->Text="符合条件数据个数为:"+IntToStr(DataModule3->ADOQuery1->RecordCount); } void __fastcall TFmain::Button6Click(TObject *Sender) { //以下为显示所有数据 AnsiString ...
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX" Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX" Begin VB.Form main_jbxx_kh BackColor = &H00C0C0C0;& ...
PhoneADOQuery->Parameters->ParamByName("date1")->Value=PhoneMaskEdit1->Text; PhoneADOQuery->Parameters->ParamByName("date2")->Value=PhoneMaskEdit2->Text; PhoneADOQuery->Active=true; //新建...
Rs1_total = Rs1.RecordCount ' set the number of rows displayed on this page If (Rs1_numRows ) Then Rs1_numRows = Rs1_total Elseif (Rs1_numRows = 0) Then Rs1_numRows = 1 End If ' set the first and ...
this.recordCount = property1; } /** * @return Returns the 每页显示记录数. */ public int getPageCount() { return pageCount; } /** * @param pageCount * The 每页显示记录数 to set. */ ...
For i = 0 To Rec.RecordCount - 1 Set nodindex = TreeView.Nodes.Add("鄯善县", tvwChild, Rec.Fields("乡镇ID"), Rec.Fields("户籍所在乡镇")) nodindex.Sorted = True Rec.MoveNext Next Rec.Close ...
-Grid中TemplateField生成到页面中控件具有唯一ID,例如Grid1_ct5_Label2,Grid1_ct6_Label2(feedback:geruger)。 +2009-09-27 v2.1.2 -为Tree控件增加GetExpandAllNodesReference和...
totalPut=rs.recordcount if currentpage<1 then currentpage=1 end if if (currentpage-1)*MaxPerPage>totalput then if (totalPut mod MaxPerPage)=0 then currentpage...
for i=1 to rs.recordcount response.Write("<tr><td>"&rs("ID")&"</td>"&_ "<td>"&rs("用户名")&"</td>"&_ "<td>"&rs("密码")&"</td></tr>") rs.movenext next end if %> </table> <h1 align="center">...
分页条控件,可以设置分页条的长度,背景色,对齐方式等 使用方式: 1,将分页条的BindMethod... this.PageBar1.RecordCount =int.Parse(cmd.Parameters[\"@RecordCount\"].Value.ToString()); con.Dispose(); }
If qy1.RecordCount = 0 Then Exit Sub End If qy1.AbsolutePage = numpage For i = 1 To qy1.PageSize '设定读取行 For j = 1 To fnumber '设定读取列 If qy1.EOF = True Then Exit Sub End If If qy1.Fields...
For i = 0 To Adodc1.Recordset.RecordCount - 1 arrData(i, 1) = Adodc1.Recordset.Fields(0) ' 在第一列设置标签。 arrData(i, 2) = Adodc1.Recordset.Fields(1) Adodc1.Recordset.MoveNext Next i ...
msg = "请将分页项设置在[1-" + dt.Rows.Count.ToString() + "]之间"; } msg = "共" + page_sum.ToString() + "页," + dt.Rows.Count.ToString() + "条";//page_num :lable DataTable page_table = new ...
response.write(\"共\"&rs.recordcount&\"条信息 \") if page<>1 then response.write(\"<a href=?page=1 title=\'首页\'>首页</a> \") else response.write(\"首页 \") end if if...
if Qeytable.RecordCount=0 then Exit; level:=0; Qeytable.First; Tree.BeginUpdate; firstlen:=Length(Qeytable[bm]);//第一层编码长度 mynode[level]:=tree.TopNode; //取根节点 while not Qeytable.Eof ...
//0.1→1,0.95→1,1.01→2,1.0→1//总页数。 tolNum; pr.Comm = new commentInfo[dt.Rows.Count]; pr.RecordCount = tolNum; for (int i = 0; i ; i++) { pr.Comm[i] = new commentInfo() { ProjectName = ...
Pager1.RecordCount = (int)Count.ExecuteScalar(); //Pager1为分页控件ID BindData(); } finally { conn.Close(); } } } //绑定数据-2 public void BindData() { SqlConnection conn = new ...