Option Explicit

'Const cConnectionString = "Uid=root;Pwd=;Driver={MySQL ODBC 3.51 Driver};Server=localhost;Port=3306;OPTION=3;Database=error" '16427
Const cConnectionString = "Uid=root;Pwd=;Driver={MySQL Connector/ODBC v5};Server=localhost;Database=error;Port=3306;OPTION=3;Database=error"

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 cx
dim rs
dim cmd

Set cx = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
Set cmd = CreateObject("ADODB.Command")

cx.Open cConnectionString
Wscript.Echo "Connection is Opend"



set cmd.ActiveConnection = cx
cmd.CommandText = "SELECT * FROM test1"
cmd.CommandType = adCmdText
Set rs = cmd.Execute
Wscript.Echo "RecordSet is Opend"
Wscript.Echo rs(0)
Wscript.Echo rs(1)

Wscript.Echo rs("Raw")

WScript.echo _
			rs.Fields(0).Name & chr(10) & _
			" Type: " & rs.Fields(0).Type & chr(10) & _
			" Size: " & rs.Fields(0).DefinedSize & chr(10) & _	
			" Scale: " & rs.Fields(0).NumericScale & chr(10) & _
			" Precision: " & rs.Fields(0).Precision


WScript.echo _
			rs.Fields(1).Name & chr(10) & _
			" Type: " & rs.Fields(1).Type & chr(10) & _
			" Size: " & rs.Fields(1).DefinedSize & chr(10) & _	
			" Scale: " & rs.Fields(1).NumericScale & chr(10) & _
			" Precision: " & rs.Fields(1).Precision


WScript.Echo (rs.Fields(0).Attributes AND 80) 'AND 4
WScript.Echo (rs.Fields(1).Attributes AND 80) 'AND 4


rs.Close()
cx.Close()
Set rs = nothing
Set cx = nothing


'DataTypeEnum Values

'Specifies the data type of a Field, Parameter, or Property object
'Constant 	Value 	Description
'adEmpty 	0 	No value
'adSmallInt 	2 	A 2-byte signed integer.
'adInteger 	3 	A 4-byte signed integer.
'adSingle 	4 	A single-precision floating-point value.
'adDouble 	5 	A double-precision floating-point value.
'adCurrency 	6 	A currency value
'adDate 	7 	The number of days since December 30, 1899 + the fraction of a day.
'adBSTR 	8 	A null-terminated character string.
'adIDispatch 	9 	A pointer to an IDispatch interface on a COM object. Note: Currently not supported by ADO.
'adError 	10 	A 32-bit error code
'adBoolean 	11 	A boolean value.
'adVariant 	12 	An Automation Variant. Note: Currently not supported by ADO.
'adIUnknown 	13 	A pointer to an IUnknown interface on a COM object. Note: Currently not supported by ADO.
'adDecimal 	14 	An exact numeric value with a fixed precision and scale.
'adTinyInt 	16 	A 1-byte signed integer.
'adUnsignedTinyInt 	17 	A 1-byte unsigned integer.
'adUnsignedSmallInt 	18 	A 2-byte unsigned integer.
'adUnsignedInt 	19 	A 4-byte unsigned integer.
'adBigInt 	20 	An 8-byte signed integer.
'adUnsignedBigInt 	21 	An 8-byte unsigned integer.
'adFileTime 	64 	The number of 100-nanosecond intervals since January 1,1601
'adGUID 	72 	A globally unique identifier (GUID)
'adBinary 	128 	A binary value.
'adChar 	129 	A string value.
'adWChar 	130 	A null-terminated Unicode character string.
'adNumeric 	131 	An exact numeric value with a fixed precision and scale.
'adUserDefined 	132 	A user-defined variable.
'adDBDate 	133 	A date value (yyyymmdd).
'adDBTime 	134 	A time value (hhmmss).
'adDBTimeStamp 	135 	A date/time stamp (yyyymmddhhmmss plus a fraction in billionths).
'adChapter 	136 	A 4-byte chapter value that identifies rows in a child rowset
'adPropVariant 	138 	An Automation PROPVARIANT.
'adVarNumeric 	139 	A numeric value (Parameter object only).
'adVarChar 	200 	A string value (Parameter object only).
'adLongVarChar 	201 	A long string value.
'adVarWChar 	202 	A null-terminated Unicode character string.
'adLongVarWChar 	203 	A long null-terminated Unicode string value.
'adVarBinary 	204 	A binary value (Parameter object only).
'adLongVarBinary 	205 	A long binary value.
'AdArray 	0x2000 	A flag value combined with another data type constant. Indicates an array of that other data type.