当前位置:网站首页>在EXCEL写VBA连接ORACLE并查询数据库中的内容
在EXCEL写VBA连接ORACLE并查询数据库中的内容
2022-07-07 06:41:00 【CSDN问答】
在EXCEL写VBA连接ORACLE并查询数据库中的内容
Sub searchDB()
Set CNN = CreateObject("ADODB.Connection")Set rst = CreateObject("ADODB.Recordset")CNN.Open "Driver={Oracle in instantclient_19_14};Dbq=mesproc;User Id=IQC_CHECKER;Password=iqc_123456;"Set rst = CNN.Execute("select iqc.no from MES_PROD.IQC_BILL iqc where iqc.no = '" & ActiveSheet.Cells(1, 2) & " '")For j = 0 To rst.Fields.Count - 1 Cells(1, j + 1) = rst.Fields(j).NameNextRange("A1").CopyFromRecordset rstCNN.CloseEnd Sub
可成功连接但是不知道怎么修改内容 ,我会写VBA查询SQLSERVER的, 但是不知道ORACLE的怎么写。 比如我知道列的名字 ,怎么去写SELECT FROM 然后选择那个单元格copyfrom 我只会跟着模板依葫芦画瓢 所以不会写了
想要根据NO号查到 各个列的值
边栏推荐
- When inputting an expression in the input box, an error is reported: incorrect string value:'\xf0\x9f... ' for column 'XXX' at row 1
- 超十万字_超详细SSM整合实践_手动实现权限管理
- The essence of high availability
- H3C vxlan configuration
- Jemter operation
- 答案在哪里?action config/Interceptor/class/servlet
- Redis common commands
- Interface test API case, data and interface separation
- Confitest of fixture py
- C语言指针(上篇)
猜你喜欢

C language pointer (special article)

On December 8th, 2020, the memory of marketing MRC application suddenly increased, resulting in system oom

Entity of cesium data visualization (Part 1)

Reflections on the way of enterprise IT architecture transformation (Alibaba's China Taiwan strategic thought and architecture practice)

MySQL common statements

External interrupt to realize key experiment

Jenkins automated email

Data association between two interfaces of postman

C语言指针(习题篇)

The configuration and options of save actions are explained in detail, and you won't be confused after reading it
随机推荐
External interrupt to realize key experiment
Common short chain design methods
PMP certificate preparation experience sharing
C语言指针(下篇)
DRF defines views and routes
Using JWT to realize login function
Postman interface test (II. Set global variables \ sets)
Postman interface debugging method
(3/8) method parameters of improper use of enumeration (2)
Selenium mouse sliding operation event
LeetCode每日一题(2316. Count Unreachable Pairs of Nodes in an Undirected Graph)
Huawei HCIP - datacom - Core 03 jours
Locust performance test 2 (interface request)
SAP MM STO单据的外向交货单创建后新加ITEM?
Postman interface test (I. installation and use)
How to pass the PMP Exam in a short time?
Pycharm importing third-party libraries
[chaosblade: node CPU load, node network delay, node network packet loss, node domain name access exception]
Systick tick timer
5A summary: seven stages of PMP learning