当前位置:网站首页>Write VBA in Excel, connect to Oracle and query the contents in the database
Write VBA in Excel, connect to Oracle and query the contents in the database
2022-07-07 09:37:00 【CSDN Q & A】
stay EXCEL Write VBA Connect ORACLE And query the contents in the database
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.Close
End Sub
You can connect successfully, but you don't know how to modify the content , I can write VBA Inquire about SQLSERVER Of , But I don't know ORACLE How to write . For example, I know the name of column , How to write SELECT FROM Then select that cell copyfrom I will only follow the template to draw gourd and gourd So I won't write
Want to base NO No. found The value of each column
边栏推荐
- [bw16 application] Anxin can realize mqtt communication with bw16 module / development board at instruction
- Mysql:select ... for update
- Vs2013 generate solutions super slow solutions
- Mysql database index study notes
- Huawei HCIP - datacom - Core 03 jours
- [cloud native] Devops (I): introduction to Devops and use of code tool
- What is MD5
- 如何使用clipboard.js库实现复制剪切功能
- 12、 Sort
- Netease cloud wechat applet
猜你喜欢
Unity3d interface is embedded in WPF interface (mouse and keyboard can respond normally)
H5 web player easyplayer How does JS realize live video real-time recording?
Mysql database index study notes
Zen - batch import test cases
Unity shader (learn more about vertex fragment shaders)
【BW16 应用篇】安信可BW16模组/开发板AT指令实现MQTT通讯
Install pyqt5 and Matplotlib module
浏览器中如何让视频倍速播放
Using JWT to realize login function
Unity uses mesh to realize real-time point cloud (I)
随机推荐
**Grafana installation**
Jmeters use
如何成为一名高级数字 IC 设计工程师(5-2)理论篇:ULP 低功耗设计技术精讲(上)
JS reverse tutorial second issue - Ape anthropology first question
asp. How to call vb DLL function in net project
Netease Cloud Wechat applet
iNFTnews | 时尚品牌将以什么方式进入元宇宙?
十二、排序
数据库多表关联查询问题
NATAPP内网穿透
First issue of JS reverse tutorial
Kubernetes cluster capacity expansion to add node nodes
Information Security Experiment 2: using x-scanner scanning tool
ViewPager2和VIewPager的区别以及ViewPager2实现轮播图
Binary tree high frequency question type
Oracle安装增强功能出错
【BW16 应用篇】安信可BW16模组/开发板AT指令实现MQTT通讯
(3/8) method parameters of improper use of enumeration (2)
Jenkins modifies the system time
细说Mysql MVCC多版本控制