Option Explicit Const cConnectionString= "Provider=MSDASQL.1;Persist Security Info=False;Extended Properties=Provider=MySQLProv;DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=test;USER=root;PASSWORD=;OPTION=16387;Initial Catalog=" Const adOpenForwardOnly = 0 Const adOpenDynamic = 2 Const adOpenStatic = 3 Const adLockReadOnly = 1 Const adLockPessimistic = 2 Const adLockOptimistic = 3 '---- ParameterDirectionEnum Values ---- Const adParamUnknown = &H0000 Const adParamInput = &H0001 Const adParamOutput = &H0002 Const adParamInputOutput = &H0003 Const adParamReturnValue = &H0004 '---- CommandTypeEnum Values ---- Const adCmdUnknown = &H0008 Const adCmdText = &H0001 Const adCmdTable = &H0002 Const adCmdStoredProc = &H0004 Const adCmdFile = &H0100 Const adCmdTableDirect = &H0200 Const adInteger=3 Const adDate=7 Const adVarChar=200 dim Connection1 dim RecordSet1 dim cmd Set Connection1 = CreateObject("ADODB.Connection") Set RecordSet1 = CreateObject("ADODB.Recordset") Set cmd = CreateObject("ADODB.Command") Connection1.Open cConnectionString Wscript.Echo "Connection is Opend" Connection1.Execute("USE test") set cmd.ActiveConnection = Connection1 cmd.CommandText = "SELECT * FROM mysql.user" cmd.CommandType = adCmdText Set RecordSet1 = cmd.Execute WScript.Echo "RS Executed.." WScript.echo _ RecordSet1.Fields(0).Name & chr(10) & _ " Type: " & RecordSet1.Fields(0).Type & chr(10) & _ " Size: " & RecordSet1.Fields(0).DefinedSize & chr(10) & _ " Scale: " & RecordSet1.Fields(0).NumericScale & chr(10) & _ " Precision: " & RecordSet1.Fields(0).Precision RecordSet1.Close With RecordSet1 '.ActiveConnection = Connection1 .LockType = 2 'adLockPessimistic .CursorType = 0 'adOpenForwardOnly End With RecordSet1.Open("SELECT * FROM mysql.user") RecordSet1.MoveFirst Do While Not RecordSet1.EOF WScript.Echo RecordSet1.Fields(1).Name WScript.Echo RecordSet1("User") RecordSet1.MoveNext Loop RecordSet1.Close Connection1.Close Set RecordSet1 = nothing Set Connection1 = nothing