zoukankan      html  css  js  c++  java
  • EXCEL表格链接SQLSEVER数据库

    Sub 数据库连接()
        Set Cnn = CreateObject("ADODB.Connection")
       Set rs = CreateObject("ADODB.Recordset")
        Cnn.ConnectionString = "Provider=SQLOLEDB;Persist Security Info=True;User ID=sa;Password=123456;Initial Catalog=运营数据库; Data Source =10.10.1.156"
        Cnn.Open
        Sql = "select 行业,SUM(帐存辅助数量)as 数量 from 运营数据库.dbo.行业分析$ group by 行业  order by 数量 desc"
          Set rs = Cnn.Execute(Sql)
          For i = 0 To rs.Fields.Count - 1
          Cells(1, i + 1) = rs.Fields(i).Name
          Next
            Range("a2").CopyFromRecordset rs
    End Sub
  • 相关阅读:
    latex
    anaconda
    git stash
    YOLO训练Pedestrain
    OpenCL C
    OpenCL
    OpenVX
    caffe源码阅读
    居住证积分查询地址
    jdk 1.8内存逐步增大的一个bug
  • 原文地址:https://www.cnblogs.com/shida-liu/p/9327603.html
Copyright © 2011-2022 走看看