cn = New ADODB.Connection
cn.Open(StrCnn)
Dim cm1 As New ADODB.Command
cm1.CommandText = "select count(*) from PT"
cm1.CommandType = ADODB.CommandTypeEnum.adCmdText
cm1.CommandTimeout = 15
cm1.Execute()
Dim num As String
If rs.EOF = False Then
num = Str(rs.???????)
TextBox4.Text = num
End If
rs = Nothing
cn.Close()
cn = Nothing
End Sub
cmd1.ExecuteScalar()就会返回第一行第一列的数据。
Dim cm1 As New ADODB.Command