Rss & SiteMap

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

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

标题:[求助]Find 的问题

1楼
sunjgjd 发表于:2011/8/16 15:39:00
刚刚接触了Foxtable没几天,正在消化中。现碰到个问题,请求帮助:

Dim dr As DataRow
dr =
DataTables("订单").Find("[产品] = 'PD01'", "日期 Desc")
If
dr IsNot Nothing Then
Dim
wz As Integer = Tables("订单").FindRow(dr)
If
wz >= 0 Then
Tables
("订单").Position = wz

End If
End If

以上这段代码,是帮助中的事例。现在的问题,PD01 在上面的代码中是个字符串常量,由于程序的需要,我需要将 PD01 改成变量(即每次查找的产品是不同的),那我应该怎么写这句涉及 Find 的代码?
先谢了!
2楼
狐狸爸爸 发表于:2011/8/16 15:42:00

Dim dr As DataRow
Dim pd As String = "PD01"
dr = DataTables("订单").Find("[产品] = '" & pd & "'", "日期 Desc")
If dr IsNot Nothing Then
    Dim wz As Integer = Tables("订单").FindRow(dr)
    If wz >= 0 Then
        Tables("订单").Position = wz
    End If
End If

 

参考:

http://www.foxtable.com/help/topics/1284.htm

http://www.foxtable.com/help/topics/1058.htm

 

不过最好还是按顺序看帮助,看三遍。

3楼
sunjgjd 发表于:2011/8/16 15:44:00
感谢狐爸!
4楼
H2H41982 发表于:2011/10/25 14:04:00

dim v as string

dr = DataTables("订单").Find("[产品] = '" & v & "'")

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

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

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