$mdb_data_Server = "172.16.102.40"
$mdb_data_id = "sa"
$mdb_data_pwd = "100200300"
$mdb_data_Company = "TestSQL"
$conn = ObjCreate("ADODB.Connection")
$RS = ObjCreate("ADODB.Recordset")
$conn.Open("driver={SQL Server};server=" & $mdb_data_Server & ";uid=" & $mdb_data_id & ";pwd=" & $mdb_data_pwd & ";database=" & $mdb_data_Company)
$RS.ActiveConnection = $conn
$RS.Open("SELECT COUNT(*) FROM ( select b.name from sysobjects as a, syscolumns as b where a.xtype = 'U' and a.id = b.id and a.name='[01mon]' ) as a Where name='2019sx'") ;?取?一列的列名?
While (Not $RS.eof And Not $RS.bof) ;循??表 有?料就跑回圈 ??料就?跳出
$Ai = $RS.Fields(0).value ;此位置真不知道在AU3中是如何用?据集里面的???表?返回值的
$RS.movenext
WEnd
MsgBox(0, "Ai為", $Ai)
|