vb ado控件查询问题
Adodc2.RecordSource = "select * from 毕业证信息表 where 姓名 in('" & List1.List(List1.ListIndex) & "')"
这句代码怎么错了啊 我想实现查询名字在listbox内的所有人员信息
VB code:
Dim i As Integer
Dim strNames As String
strNames = ""
For i = 1 To List1.ListCount
strNames = ",'" & List1.Text & "'"
Next i
strNames = Right(strNames, Len(strNames) - 1)
If Len(strNames) = 0 Then
Exit Sub
End If
Adodc2.RecordSource = "select * from 毕业证信息表 where 姓名 in(" & strNames & ")"
in()括号内的各元素要用逗号隔开
VB code:
Private Sub Command1_Click()
Dim i As Long, strTmp As String
For i = 0 To List1.ListCount-1
strTmp = IIf(strTmp = "", "'" & List1.List(i) & "'", strTmp & ",'" & List1.List(i) & "'")
Next i
Adodc2.RecordSource = "select * from 毕业证信息表 where 姓名 in(" & strTmp & ")"
End Sub
相关问答:
Printer.ScaleMode = 6
6表示毫米
Printer.PaperSize = vbPRPSA4
'初始坐标
x = 1
y = 4
'最大的线筐
Printer.DrawStyle = 0
Printer.Line (x, y)-(x + 132.5, y) ......
希望大家能够帮我下.感谢了..
源码传在大米盘 VB6 的源码 http://www.damipan.com/file/3wNoKLW.html
转为VB.NET源码.
小弟完全是新手 不懂的说.麻烦各位帮忙一下
我的EMAIL是:4452 ......
VB偶学得不错,现在大一,高三的时候就学VB了,现在学校里都是学C#和VB.NET的兄弟多。。。
偶要转行VB.NET了~当年学VB学了2年,对VB里面的常用函数都十分了解。
Select、If结构、For Next循环、等都了解。。。 ......
我用C#写了一个COM。
其他有2个类,一个类就是普通方法。调用没问题。
另一个类是用户控件。我在VB中如何把那个控件显示出来?
VB调COM中,COM 是个控件。
谢谢高手指点。
......