当前位置:网站首页>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
边栏推荐
- scrapy爬虫mysql,Django等
- thinkphp数据库的增删改查
- La différence entre viewpager 2 et viewpager et la mise en œuvre de la rotation viewpager 2
- VSCode+mingw64+cmake
- Regular matching starts with XXX and ends with XXX
- Variable parameter of variable length function
- [SVN] what is SVN? How do you use it?
- Oracle安装增强功能出错
- Where is the answer? action config/Interceptor/class/servlet
- H5网页播放器EasyPlayer.js如何实现直播视频实时录像?
猜你喜欢
十二、排序
NATAPP内网穿透
esp8266使用TF卡并读写数据(基于arduino)
Oracle安装增强功能出错
Impression notes finally support the default markdown preview mode
Variable parameter of variable length function
数据建模中利用3σ剔除异常值进行数据清洗
Difference between interface iterator and iteratable
Unity3d interface is embedded in WPF interface (mouse and keyboard can respond normally)
Information Security Experiment 1: implementation of DES encryption algorithm
随机推荐
4、 Fundamentals of machine learning
[4G/5G/6G专题基础-147]: 6G总体愿景与潜在关键技术白皮书解读-2-6G发展的宏观驱动力
Lesson 1: finding the minimum of a matrix
網易雲微信小程序
PLC信号处理系列之开关量信号防抖FB
Integer or int? How to select data types for entity classes in ORM
Windows starts redis service
Diffusion模型详解
进程间的通信方式
Niuke - Huawei question bank (61~70)
Information Security Experiment 2: using x-scanner scanning tool
Mysql:select ... for update
Interface test API case, data and interface separation
iNFTnews | 时尚品牌将以什么方式进入元宇宙?
flinkcdc 用sqlclient可以指定mysqlbinlog id执行任务吗
其实特简单,教你轻松实现酷炫的数据可视化大屏
Unity uses mesh to realize real-time point cloud (II)
華為HCIP-DATACOM-Core_03day
MongoDB怎么实现创建删除数据库、创建删除表、数据增删改查
**grafana安装**