vb 中如何访问oracle数据库中其他字段,以下这段程序我可以访问并输出dba01表中第一个字段jh的数据
PrivateSubCommand1_Click()Dima(50)AsStringDimmysqlstrAsStringSetconn=Newadodb.Connect...
Private Sub Command1_Click()
Dim a(50) As String
Dim mysqlstr As String
Set conn = New adodb.Connection
Set rs = New adodb.Recordset
conn.ConnectionString = "Provider=MSDAORA.1;User ID=xxxxx;Password=yyyyy;Data Source=220;Persist Security Info=False;"
conn.Open
mysqlstr = "select * from DBA01 "
Set rs = conn.Execute(mysqlstr) '建立记录集
For i = 1 To 50
a(i - 1) = rs("JH")
T_rs.Text = T_rs.Text & a(i - 1) & Chr(13) + Chr(10)
If Not rs.EOF Then rs.MoveNext
Next
End Sub
我想访问其他字段时候照着上边仿写比如把jh改成cc(另一个字段),就不行显示无效使用null,应该怎么改才能访问呢 展开
Dim a(50) As String
Dim mysqlstr As String
Set conn = New adodb.Connection
Set rs = New adodb.Recordset
conn.ConnectionString = "Provider=MSDAORA.1;User ID=xxxxx;Password=yyyyy;Data Source=220;Persist Security Info=False;"
conn.Open
mysqlstr = "select * from DBA01 "
Set rs = conn.Execute(mysqlstr) '建立记录集
For i = 1 To 50
a(i - 1) = rs("JH")
T_rs.Text = T_rs.Text & a(i - 1) & Chr(13) + Chr(10)
If Not rs.EOF Then rs.MoveNext
Next
End Sub
我想访问其他字段时候照着上边仿写比如把jh改成cc(另一个字段),就不行显示无效使用null,应该怎么改才能访问呢 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询