VB里,想将SQL某一表里某一字段值中的最大值取出使用,请问该怎么写代码呢
2个回答
展开全部
Set mConn = New ADODB.Connection
Set mrs = New ADODB.Recordset
mConn.Open "Provider=sqloledb;Password=dili1server@;Persist Security INfo = True;" _
& "User ID = sa;Initial Catalog = bqerp;Data Source =192.168.20.1;Connect Timeout=30"
sCmd = " select top 1 某字段名 from 某表名 order by 某字段名 desc"
Call openmrs
If mrs.EOF = false Then
结果变量=mrs(0)
end if
Set mrs = New ADODB.Recordset
mConn.Open "Provider=sqloledb;Password=dili1server@;Persist Security INfo = True;" _
& "User ID = sa;Initial Catalog = bqerp;Data Source =192.168.20.1;Connect Timeout=30"
sCmd = " select top 1 某字段名 from 某表名 order by 某字段名 desc"
Call openmrs
If mrs.EOF = false Then
结果变量=mrs(0)
end if
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询