【发布时间】:2019-08-16 06:50:01
【问题描述】:
我有一个查询,我需要在其中添加 查询语句 并将该详细信息提取到 Excel 工作表中
表格名称是:Student_Details
ID|Name|Course|
1 |vik |MBA |
2 |sik |CA |
3 |mil |CP |
4 |hil |MP |
query : Select * from Student_Details;
如何在下面的查询中实现
Sub Ora_Connection()
Dim con As ADODB.Connection
Dim rs As ADODB.Recordset
Dim query As String
Set con = New ADODB.Connection
Set rs = New ADODB.Recordset
'--- Replace below highlighted names with the corresponding values
strCon = "Driver={Microsoft ODBC for Oracle}; " & _
"CONNECTSTRING=(DESCRIPTION=" & _
"(ADDRESS=(PROTOCOL=TCP)" & _
"(HOST=ora130b-example.intra)(PORT=1534))" & _
"(CONNECT_DATA=(SERVICE_NAME=JFG))); uid=jfg_o; pwd=ure;"
'--- Open the above connection string.
con.Open (strCon)
'--- Now connection is open and you can use queries to execute them.
'--- It will be open till you close the connection
con.Close
End Sub
【问题讨论】: