VBS+ADOでMDBアクセス
2006/01/22
Categories: wsh
Set connection = CreateObject( "ADODB.Connection" )
connection_string = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=MDBファイル;"
connection.Open connection_string
Set rs = CreateObject( "ADODB.Recordset" )
Set rs.ActiveConnection = connection
sql = "SELECT ServerName , Community , Status FROM SERVER_LIST "
rs.Open( sql )
While rs.EOF <> true
s = rs.Fields("ServerName").Value & " " & rs.Fields("Community").Value & " " & rs.Fields("Status").Value
WScript.Echo s
rs.MoveNext()
Wend
rs.close
connection.close
>cscript //nologo ado.vbs
host1 public OK
host2 aaa BAD
>
>> Home