Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共4 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:如何找到最后一条或上一条或下一条或第一条记录

1楼
baoxyang 发表于:2009/4/17 18:17:00
dim tt as string
Dim cmd As New SQLCommand
dim dt as datatable
cmd.C
cmd.commandtext = "select * From [入库] where 单号 like 'IP%' "
dt = cmd.ExecuteReader()
dim dr as datarow
如何编写找到最后一条或上一条或下一条或第一条记录语句。
tt = dr(“列A”)(最后一条)
tt = dr(“列A”)(上一条)
tt = dr(“列A”)(下一条)
tt = dr(“列A”)(第一条)
谢谢帮忙!

2楼
易服 发表于:2009/4/17 23:09:00

第一行:
Tables("表名").Position = 0
上一行:
With Tables("表名")
    .Position = .Position - 1
End With
下一行:
With Tables("表名")
    .Position = .Position + 1
End With

最末行:
With Tables("表名")
    .Position = .Rows.Count - 1
End With

3楼
baoxyang 发表于:2009/4/18 8:28:00

谢了,我已解决了。

4楼
yangming 发表于:2009/4/19 15:28:00

通用的,表示当前表:

第一行:
With CurrentTable
    .Position = 0
End With


上一行:
With CurrentTable 
    .Position = .Position - 1
End With

下一行:
With CurrentTable 
    .Position = .Position + 1
End With


最末行:
With CurrentTable 
    .Position = .Rows.Count - 1
End With

共4 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .01996 s, 2 queries.