adoconst(adotype)Converts an ADO type value into the corresponding generic type
string. Calling adotype.adoconst(, for
example, would return the string 16)"adTinyInt". This is useful when using the OpenSchema method of the ADO Connection object to
generate ADO script code.
simpletype(adotype)Converts an ADO type value into the corresponding generic type
string. Calling adotype.simpletype(, for
example, would return the string 16)"int".
datatype(adotype,size,precision,scale,flags)Generates a generic type string that corresponds to the ADO type, size, precision, and scale using the given flags.
mssql(adotype,size,precision,scale,flags)Returns a MSSQL type string for the ADO type, size, precision, and scale using the given flags (if possible).
vbs(adotype,size,precision,scale,flags)Returns a VBScript type string for the ADO type, size, precision, and scale using the given flags (if possible).
<html><head><title>Table Columns</title></head><body><%Setadotype=Server.CreateObject("ADOType.WSC")Setconn=Server.CreateObject("ADODB.Connection")conn.Properties("Prompt")=ADODB.adPromptCompleteconn.OpenApplication("ConnectString")Setrs=conn.OpenSchema(ADODB.adSchemaColumns,Request("table")) %><tableborder="0"cellpadding="2"cellspacing=">0"<caption><%=Request("table") %></caption><tr><th>Column</th><th>Datatype</th><th>Nullable</th><th>Default</th></tr><%DoUntilrs.EOF%><tr><td><%=rs("COLUMN_NAME") %></td><td><%=adotype.mssql(rs("DATA_TYPE"),rs("CHARACTER_MAXIMUM_LENGTH"),rs("NUMERIC_PRECISION"),rs("NUMERIC_SCALE")) %></td><td><%Ifrs("IS_NULLABLE")Then%>null<%Else%>not null<%EndIf%></td><td><%=rs("COLUMN_DEFAULT") %></td></tr><%rs.MoveNext:Loop%></table><%conn.Close%></body></html>
<?xml version="1.0" ?><package><jobid=">default"<objectid="conn"progid="/>ADODB.Connection"<referenceobject="/>ADODB.Connection"<scriptlanguage=">jscript"<![CDATA[conn.Properties('Prompt')=ADODB.adPromptComplete;conn.Open();varadodir=newArray('adParamUnknown','adParamInput','adParamOutput','adParamInputOutput','adParamReturnValue');varadotype=WScript.CreateObject('ADOType.WSC');varrs=conn.OpenSchema(ADODB.adSchemaProcedureParameters,Array(null,null,WScript.Arguments.Named('proc')));WScript.Echo('Set cmd= CreateObject("ADODB.Command")');for(;!rs.EOF;rs.MoveNext()) {if(rs('NUMERIC_SCALE').Value!=null)WScript.Echo('Set param= cmd.CreateParameter("'+rs('PARAMETER_NAME').Value+'",ADODB.'+adotype.adoconst(rs('DATA_TYPE').Value)+',ADODB.'+adodir[rs('PARAMETER_TYPE').Value]+','+rs('CHARACTER_MAXIMUM_LENGTH').Value+')\n param.Precision= '+rs('NUMERIC_PRECISION')+': param.NumericScale= '+rs('NUMERIC_SCALE')+': cmd.Parameters.Append param');elseWScript.Echo('cmd.Parameters.Append cmd.CreateParameter("'+rs('PARAMETER_NAME').Value+'",ADODB.'+adotype.adoconst(rs('DATA_TYPE').Value)+',ADODB.'+adodir[rs('PARAMETER_TYPE').Value]+','+rs('CHARACTER_MAXIMUM_LENGTH').Value+')'); }]]></script></job></package>
Download adotype.wsc to the web server (somewhere permanent, like a system directory).
Right-click the file and choose .