热门

最新

红包

立Flag

投票

同城

我的

发布
weixin_49998777
建超sunny
3 年前
trueweixin_49998777

Set CN = CreateObject("ADODB.Connection") '?VBA读取数据库表写法

Set rs = CreateObject("ADODB.RecordSet") '??????????????????????????????????

Dim strCn As String, strSQL As String '???????????????????

'?????????????????????
strCn = "Provider=MSDASQL;Driver={MySQL ODBC 5.2 Unicode Driver};Server=00.00.00.00;DB=xxx;UID=xxx;PWD=123123;OPTION=3;"


Dim i, j, m, n As Integer, sht_single As Worksheet, sht_diff As Worksheet 'i,j???????????sht ?excel?????????????????????????
i = 1
Set sht_single = ThisWorkbook.Worksheets("?????迹")
Set sht_diff = ThisWorkbook.Worksheets("???迹")
strSQL = "select * from impedance_eq where gulpn = '" & gulpn & "' AND ic_area='Rigid area' and (original_space='' or original_space='NA')" '????SQL???
CN.Open strCn '??????
rs.Open strSQL, CN '?????????е?????
Do While Not rs.EOF

sht_single.Cells(Single_End_Rigid_Area_Start_R + i, 10).Value = rs.Fields(3).Value '????????4??ohm?????

CSDN App 扫码分享
分享
评论
1
打赏
  • 复制链接
  • 举报
下一条:
时光不会被辜负,勿忘初心
立即登录