这是个查询 我已经查出内容了 但是我现在想把查出的内容显示在text文本框里。忘了怎么写了呵呵
各位大侠 帮个忙指点下 哈哈··
sSql = "SELECT " & sCol & " FROM " & sTable & " WHERE " & sWhere
Set colDataCollection = moProRawSql.QueryDatabase(sSql)
If colDataCollection.count = 0 Then
Call RaiseError(glERR_ERRMSG, _
FormatErrorText(gsETX_ERRMSG, "Can not get any Records.", "数据库没有您要查到中文")) Else
Chain_text.Text =
?????查询到到CNAME显示出来
End If
各位大侠 帮个忙指点下 哈哈··
sSql = "SELECT " & sCol & " FROM " & sTable & " WHERE " & sWhere
Set colDataCollection = moProRawSql.QueryDatabase(sSql)
If colDataCollection.count = 0 Then
Call RaiseError(glERR_ERRMSG, _
FormatErrorText(gsETX_ERRMSG, "Can not get any Records.", "数据库没有您要查到中文")) Else
Chain_text.Text =
?????查询到到CNAME显示出来
End If
解决方案 »
- 【看怪物来呀】发现个专门灌水的家伙,呵呵,顺便散分
- 获得某进程相对应的CPU占用率
- 请问 各位 如何在 ListView1 上加一个垂直滚动条 ??
- 紧急求救! 哪位好心人帮帮忙啊!
- 求函数
- ListBox控件中,如何实现
- 谁有状态栏进度条的例子啊
- 想在explorer中实现文档文件预览 即鼠标移到某个文件上自动出来一个窗体来预览这个文件 vb能否实现?
- 为什么我这样的代码对datagrid不能绑定(ADO)
- 怎样在vb中发送html页面的email?(不能用控件)
- 请教各位我想将一个文本文件里面的所有文字拷贝到剪贴板,然后复制出来……
- crystal report一列数字,一列为是否完成,数字大于0显示完成,怎样做?
如果是recordset的话
txt.text=colDataCollection.fields(0)就好了
Set rs = moProRawSql.QueryDatabase(sSql)
If colDataCollection.count = 0 Then
Call RaiseError(glERR_ERRMSG, _
FormatErrorText(gsETX_ERRMSG, "Can not get any Records.", "数据库没有您要查到中文")) Else
Chain_text.Text = rs.fields(0)
'?????查询到到CNAME显示出来
End If
Dim s As String, tmp As String
Do While Not colDataCollection.EOF()
For i = 0 To colDataCollection.Fields.Count - 1
s = s + CStr(colDataCollection.Fields(i).Value) + ","
Next
tmp = tmp + s + vbCrLf
s = ""
colDataCollection.MoveNext
Loop
Chain_text.Text = tmp
Set rs = moProRawSql.QueryDatabase(sSql)
If colDataCollection.count = 0 Then
Call RaiseError(glERR_ERRMSG, _
FormatErrorText(gsETX_ERRMSG, "Can not get any Records.", "数据库没有您要查到中文")) Else Dim i As Long
Dim s As String, tmp As String
Do While Not colDataCollection.EOF()
For i = 0 To colDataCollection.Fields.Count - 1
s = s + CStr(colDataCollection.Fields(i).Value) + ","
Next
tmp = tmp + s + vbCrLf
s = ""
colDataCollection.MoveNext
Loop
Chain_text.Text = tmp End If
如果是单行,直接使用chain_text.text=rs!字段名
如果是多行,可以先连接数据后再赋值,比如:s=rs.getstring():chain_text.text=s