当前位置:网站首页>在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号查到 各个列的值
边栏推荐
- Pycharm create a new file and add author information
- The configuration and options of save actions are explained in detail, and you won't be confused after reading it
- Mysql database lock learning notes
- What is MD5
- C语言指针(特别篇)
- Huawei HCIP - datacom - Core 03 jours
- JVM 内存结构 详细学习笔记(一)
- Druid monitoring - Introduction to JMX usage and principle
- C语言指针(上篇)
- 【云原生】DevOps(一):DevOps介绍及Code工具使用
猜你喜欢

What is the use of PMP certificate?

Mysql database transaction learning notes

C language pointer (Part 1)

Upgrade Alibaba cloud RDS (relational database service) instance to com mysql. jdbc. exceptions. Troubleshooting of jdbc4.communicationsexception

C语言指针(习题篇)

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

PMP Exam details after the release of the new exam outline

NVIC中断优先级管理

Jenkins automated email

Postman interface test (II. Set global variables \ sets)
随机推荐
Run can start normally, and debug doesn't start or report an error, which seems to be stuck
Interpretation of MySQL optimization principle
Systick tick timer
Jenkins+ant+jmeter use
Interview question: general layout and wiring principles of high-speed PCB
(3/8)枚举的不当用法 之 方法参数(二)
MySQL common statements
華為HCIP-DATACOM-Core_03day
华为HCIP-DATACOM-Core_03day
NVIC interrupt priority management
Analysis of Hessian serialization principle
Confitest of fixture py
Reflections on the way of enterprise IT architecture transformation (Alibaba's China Taiwan strategic thought and architecture practice)
Sublime Text4 download the view in bower and set the shortcut key
Regular matching starts with XXX and ends with XXX
Unittest simple project
Port occupation troubleshooting
Summary of PMP learning materials
When inputting an expression in the input box, an error is reported: incorrect string value:'\xf0\x9f... ' for column 'XXX' at row 1
Mysql database lock learning notes