我是这样定义的:
dim db as DAo.database
dim sqlstr as string
dim netpath as stringSet DB = OpenDatabase(NetPath)
SQLstr = "select * from table1 where no1=" & Text2.text
db.execute sqlstr
我想知道select的结果是不是为空,怎么办?
也不知道db.execute sqlstr返回的是什么信息,这个语句直接在库里操作了。最后给我的是什么信息,我想根据此信息来判断有没有当前选的记录....
dim db as DAo.database
dim sqlstr as string
dim netpath as stringSet DB = OpenDatabase(NetPath)
SQLstr = "select * from table1 where no1=" & Text2.text
db.execute sqlstr
我想知道select的结果是不是为空,怎么办?
也不知道db.execute sqlstr返回的是什么信息,这个语句直接在库里操作了。最后给我的是什么信息,我想根据此信息来判断有没有当前选的记录....
解决方案 »
- 求ASP反向加密算法,就下面的ASP解密代码还原成VB6.0加密码算法,分全给你们了
- form重新获得焦点问题
- 求简单的删除Cookie代码,一定要VB的!
- 怎么应用MTS
- VB的List的用法的两个小问题,谢谢!
- 用VB实现共享某个文件夹?
- MSHFlexGrid 控件的动态定位问题?
- 急!!在文本框中全选所有文本的代码要怎样编写??
- 那里有象OICQ标题栏最小和关闭按钮大小的漂亮图标???????
- 如何将 Label1.BackColor 的颜色值转换成网页格式的“#××××××"格式的数值?
- 请问关于LISTBOX列表框的问题?
- 请问在PB里面一般是用什么连接SQL Server6.5的?
loop 单步执行,如果rs.eof为true则没有找到记录
dim db as DAo.database
dim sqlstr as string
dim netpath as stringSet DB = OpenDatabase(NetPath)
SQLstr = "select * from table1 where no1=" & Text2.text
dim Rs as recordset
set rs= db.execute sqlstr
if rs.eof then
'没有记录
else
'有记录
endif
或
set msflixgrid.datasource=db
如果發生變化,它會在表中顯示出來的。
dim sqlstr as string
dim netpath as string
dim mRst As New ADODB.RecordsetmRst.CursorLocation = adUseClient
Set DB = OpenDatabase(NetPath)
SQLstr = "select * from table1 where no1=" & Text2.text
Set mRst = db.execute sqlstr
If mRst.Bof And mRst.Eof Then
Msgbox "记录集空"
Else
Msgbox "记录集非空"
End If