当前位置:网站首页>在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号查到 各个列的值
边栏推荐
- Hard core sharing: a common toolkit for hardware engineers
- Why is access to the external network prohibited for internal services of the company?
- What is MD5
- Upgrade Alibaba cloud RDS (relational database service) instance to com mysql. jdbc. exceptions. Troubleshooting of jdbc4.communicationsexception
- Reflections on the way of enterprise IT architecture transformation (Alibaba's China Taiwan strategic thought and architecture practice)
- [chaosblade: node disk filling, killing the specified process on the node, suspending the specified process on the node]
- [SVN] what is SVN? How do you use it?
- STM32的时钟系统
- stm32和电机开发(从单机版到网络化)
- C语言指针(下篇)
猜你喜欢

Implementation of corner badge of Youmeng message push

Huawei hcip datacom core_ 03day

网易云微信小程序

Common short chain design methods

Unittest simple project

How to pass the PMP Exam in a short time?

Zen - batch import test cases

C language pointer (exercises)

Locust performance test 2 (interface request)

What are the conditions for applying for NPDP?
随机推荐
Mysql database lock learning notes
PMP Exam Preparation experience, seek common ground while reserving differences, and successfully pass the exam
Serial port experiment - simple data sending and receiving
Cesium does not support 4490 problem solution and cesium modified source code packaging scheme
Two schemes of unit test
超十万字_超详细SSM整合实践_手动实现权限管理
Reading notes of pyramid principle
Interview question: general layout and wiring principles of high-speed PCB
JVM 垃圾回收 详细学习笔记(二)
5A summary: seven stages of PMP learning
C language pointer (Part 1)
[istio introduction, architecture, components]
Count the number of words C language
Confitest of fixture py
C语言指针(习题篇)
十二、排序
信息安全实验二 :使用X-SCANNER扫描工具
Count the number of words in the string c language
The use of recycling ideas
网易云微信小程序