当前位置:网站首页>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
边栏推荐
- 第一讲:包含min函数的栈
- 第一讲:鸡蛋的硬度
- [bw16 application] Anxin can realize mqtt communication with bw16 module / development board at instruction
- [cloud native] Devops (I): introduction to Devops and use of code tool
- sqlplus乱码问题,求解答
- The difference between viewpager2 and viewpager and the implementation of viewpager2 in the rotation chart
- 进程间的通信方式
- What is MD5
- Unity3d interface is embedded in WPF interface (mouse and keyboard can respond normally)
- 第一讲:寻找矩阵的极小值
猜你喜欢
嵌套(多级)childrn路由,query参数,命名路由,replace属性,路由的props配置,路由的params参数
How will fashion brands enter the meta universe?
VSCode+mingw64
[4g/5g/6g topic foundation-146]: Interpretation of white paper on 6G overall vision and potential key technologies-1-overall vision
Arthas simple instructions
正则匹配以XXX开头的,XXX结束的
Dynamics 365Online ApplicationUser创建方式变更
JS逆向教程第一发
[SVN] what is SVN? How do you use it?
信息安全实验四:Ip包监视程序实现
随机推荐
Mysql:select ... for update
第一讲:寻找矩阵的极小值
[bw16 application] Anxin can realize mqtt communication with bw16 module / development board at instruction
thinkphp3.2信息泄露
二叉树高频题型
细说Mysql MVCC多版本控制
Jenkins automated email
Unity shader (to achieve a simple material effect with adjustable color attributes only)
The use of recycling ideas
Dynamics 365Online ApplicationUser创建方式变更
Integer or int? How to select data types for entity classes in ORM
Elaborate on MySQL mvcc multi version control
shake数据库中怎么使用Mongo-shake实现MongoDB的双向同步啊?
Unittest simple project
Unity shader (basic concept)
Huawei hcip datacom core_ 03day
答案在哪里?action config/Interceptor/class/servlet
VSCode+mingw64
Unity uses mesh to realize real-time point cloud (I)
liunx命令