|
- Dim adoConn
- Dim ConnectionStr
- ConnectionStr ="Provider=MSDAORA.1;User ID=test;Password=test;Data Source=ORCL;Persist Security Info=False"
- sqlStr = "select * from CORE_APP_DEPARTMENT"
- Set adoConn = CreateObject("ADODB.Connection")
- adoConn.Open ConnectionStr
- if adoConn.state <> 0 Then
- msgbox "数据库连接成功!"
- Set adoRst = adoConn.Execute(sqlStr)
- For i=1 to adoRst.Fields.Count
- MsgBox adoRst.Fields.Item("DEPARTNAME").Value
- adoRst.MoveNext
- Next
- msgbox adoRst.Fields.Count
- End If
- adoConn.Close
- Set adoConn = nothing
复制代码 sql语句是从plsql里直接拷出来的,plsql里可以查询出数据 |
|