VBScript Sample: vbscript/ado/webaccess/designtb.asp
   ASP Script
   Comments or Client-side Script
   HTML and Text

<%@  Language=VBScript  %>
<HTML>
<HEAD>
<SCRIPT language=JavaScript>
  var dbms = "<%=dbms%>";

function  ChgType(){
  typeVal =  parseInt(document.form1.fdType.selectedIndex);
   switch ( typeVal ) {
  case  12:
  case  13:
   document.form1.fdSize.value = "18,  0";
   break;
  case  26:
  case 29:
   case 32:
   document.form1.fdSize.value =  "10";
   break;
  case  27:
  case 20:
   case 33:
   document.form1.fdSize.value =  "50";
   break;
   default:
   document.form1.fdSize.value = "";
   }
  }

  function addField_onClick(){
   var name = document.form1.fdName.value;
  if  (name.length <  1){
  alert("Field  name is  required.");
   return;
  }
  ch  = name.charAt(0);
  if (ch < 'A' || (ch  > 'Z' && ch < 'a') || ch > 'z')     {
  alert("Invalid field name.");
   return;
  } 
   for (i = 0; i < name.length; i++) {
   ch =  name.charAt(i);
   if ( (ch < '0' || (ch > '9' && ch < 'A') || (ch  >    'Z' && ch < 'a') || ch > 'z') && ch != '_'  ){
  alert("Invalid field name.");
   return;
  }
   }
  if (document.form1.fdType.selectedIndex ==  0) {
   alert("Please select a field type.");
   return;
  }
  if  ( (document.form1.fdType.selectedIndex == 25 ||  document.form1.fdType.selectedIndex    == 26 ||  
   document.form1.fdType.selectedIndex == 27 || document.form1.fdType.selectedIndex     == 29 || 
  document.form1.fdType.selectedIndex  == 30 || document.form1.fdType.selectedIndex    == 32 ||  
  document.form1.fdType.selectedIndex == 33 )  && 
  ( isNaN(  parseInt(document.form1.fdSize.value) ) || parseInt(document.form1.fdSize.value)     == 0 )
  )  {
  alert("Field size is required.");
   return;
   }

 if ( document.form1.fdType.selectedIndex  == 12 || document.form1.fdType.selectedIndex    == 13 )  {
  if  (document.form1.fdSize.value == "")  {
   alert("Please enter a number in the form of: 18,     0");
   return;
   }
  pos =  document.form1.fdSize.value.indexOf(",");
   if ( pos == -1 )  {
   alert("Please enter a number in the form of: 18,     0");
   return;
   }
  if ( isNaN(  parseInt(document.form1.fdSize.value.substring(0, pos)) )     ||
   parseInt(document.form1.fdSize.value.substring(0, pos)) == 0 )  {
   alert("Please enter a number in the form of: 18,     0");
   return;
   }
  if ( isNaN(  parseInt(document.form1.fdSize.value.substring(pos + 1)) )     ||
   parseInt(document.form1.fdSize.value.substring(0, pos + 1)) == 0 )  {
   alert("Please enter a number in the form of: 18,     0");
   return;
   }
  }

  lstLen = document.form1.listName.length;
  for  (i = 0; i < lstLen - 1;  i++){
  if  (document.form1.listName.options[i].text == document.form1.fdName.value)     {
   alert("Field name already exists.");
   return;
   }
  }

 str  = AddFieldSQL();

 if (str.indexOf("Error:")  != -1) {
   return;
   }

 document.form1.SQLsentence.value =  str;
   document.form1.submit();
  }

function  AddFieldSQL(){
  var  sqlsent;
  switch( dbms )  {
  case  "Access":
  case  "MySQL":
  case  "Oracle":
  case  "SQLServer":
  case  "Sybase":
  case "MiniSQL":  
  case "Postgres":  
  sqlsent =  "ALTER TABLE <%=tbName%> ADD  ";
   break;

 case  "Informix":
   sqlsent = "ALTER TABLE <%=tbName%> ADD  (";
   break;
  }
   
  fdN =  document.form1.fdName.value;
  fdS =  document.form1.fdSize.value;
  adoType =  document.form1.fdType.options[document.form1.fdType.selectedIndex].text;
   fdT = fieldDataType(adoType);

 if  (fdT.indexOf("Error:") != -1)  {
  alert("The filed type, ( " + adoType + " ), is not supported in the specified database.");
   return "Error:";
   }
  
  if ( adoType ==  "adChar" || adoType == "adVarChar" ||    adoType == "adWChar"  ||
  adoType ==  "adVarWChar" || adoType == "adDecimal" ||    adoType == "adNumeric" )  {
  sqlsent = sqlsent + fdN +  " " + fdT + "(" + fdS + ")";

 } else if (  adoType == "adBinary" || adoType == "adVarBinary"    )  {
  if ( dbms ==  "MySQL" )  {
   sqlsent = sqlsent + fdN + " " +  fdT;
  } else  {
   sqlsent = sqlsent + fdN + " " + fdT + "(" + fdS +     ")";
   }
  } else  {
  sqlsent =  sqlsent + fdN + " " + fdT;
  }  

 if ( dbms == "Informix" )  {
  sqlsent +=  ")";
  } else  {
  sqlsent += "  NULL";
  }

  return sqlsent;
  }
  function  ridField_onClick(){
  if ( dbms == "Access" ||  dbms == "Cloudscape" || dbms    == "Oracle"  ){
  alert("The database doesn't support this operation.");
   return;
  }
   var selIdx =  document.form1.listName.selectedIndex;
  if (  selIdx < document.form1.listName.length && selIdx > -1    )  {
   document.form1.SQLsentence.value =  DropFieldSQL();
   document.form1.submit();
   }
  }

function DropFieldSQL(){
  var  sqlsent = "";
  selIdx =  document.form1.listName.selectedIndex;
  fdN =  document.form1.listName.options[selIdx].text;

  switch( dbms )
   {
  case  "Informix":
   sqlsent = "ALTER TABLE <%=tbName%> DROP  (" + fdN + ")";
   break;
  case  "Sybase":
  case  "MySQL":
  case "MiniSQL":  //?
  case "Postgres":  //?
  sqlsent =  "ALTER TABLE <%=tbName%> DROP " +  fdN;
   break;
  case  "SQLServer":
   sqlsent = "ALTER TABLE <%=tbName%> DROP  COLUMN " + fdN;
   break;
  }
   return sqlsent;
  }

function  fieldDataType(adoType){
  if (dbms == "Access")  { //1
  switch (  adoType ) {
  case  "adTinyInt":
   FdType =  "BYTE";
   break;
  case  "adSmallInt":
   FdType =  "SMALLINT";
   break;
  case  "adInteger":
   FdType =  "INTEGER";
   break;
  case  "adUnsignedInt":
   FdType =  "COUNTER";
   break;
  case  "adSingle":
   FdType =  "REAL";
   break;
  case  "adDouble":
   FdType =  "DOUBLE";
   break;
  case  "adCurrency":
   FdType =  "CURRENCY";
   break;
  case  "adBoolean":
   FdType =  "BIT";
   break;
  case  "adGUID":
   FdType =  "GUID";
   break;
  case  "adDBTimeStamp":
   FdType =  "DATETIME";
   break;
  case  "adChar":
   FdType =  "CHAR";
   break;
  case  "adVarChar":
   FdType =  "VARCHAR";
   break;
  case  "adLongVarChar":
   FdType =  "LONGCHAR";
   break;
  case  "adBinary":
   FdType =  "BINARY";
   break;
  case  "adVarBinary":
   FdType =  "VARBINARY";
   break;
  case  "adLongVarBinary":
   FdType =  "LONGBINARY";
   break;
   default:
   FdType =  "Error:";
   }

 } else if (dbms == "SQLServer") {  //2
  switch (  adoType ) {
  case  "adTinyInt":
   FdType =  "tinyint"
   break;
  case  "adSmallInt":
   FdType =  "smallint";
   break;
  case  "adInteger":
   FdType =  "int";
   break;
  case  "adSingle":
   FdType =  "real";
   break;
  case  "adDouble":
   FdType =  "float";
   break;
  case  "adCurrency":
   FdType =  "money";
   break;
  case  "adDecimal":
   FdType =  "decimal";
   break;
  case  "adNumeric":
   FdType =  "numeric";
   break;
  case  "adBoolean":
   FdType =  "bit";
   break;
  case  "adGUID":
   FdType =  "uniqueidentifier";
   break;
  case  "adDBTimeStamp":
   FdType =  "datetime";
   break;
  case  "adChar":
   FdType =  "char";
   break;
  case  "adVarChar":
   FdType =  "varchar";
   break;
  case  "adLongVarChar":
   FdType =  "text"
   break;
  case  "adWChar":
   FdType =  "nchar";
   break;
  case  "adVarWChar":
   FdType =  "nvarchar";
   break;
  case  "adLongVarWChar":
   FdType =  "ntext";
   break;
  case  "adBinary":
   FdType =  "binary";
   break;
  case  "adVarBinary":
   FdType =  "varbinary";
   break;
  case  "adLongVarBinary":
   FdType =  "image";
   break;
   default:
   FdType =  "Error:";
   }
  } else if ( dbms == "MySQL") {  //3
  switch (  adoType ) {
  case  "adTinyInt":
   FdType =  "tinyint"
   break;
  case  "adSmallInt":
   FdType =  "smallint";
   break;
  case  "adInteger":
   FdType =  "int";
   break;
  case  "adBigInt":
   FdType =  "bigint";
   break;
  case  "adUnsignedTinyInt":
   FdType = "tinyint  unsigned";
   break;
  case  "adUnsignedSmallInt":
   FdType = "smallint  unsigned";
   break;
  case  "adUnsignedInt":
   FdType = "int  unsigned";
   break;
  case  "adUnsignedBigInt":
   FdType = "bigint  unsigned";
   break;
  case  "adSingle":
   FdType =  "float";
   break;
  case  "adDouble":
   FdType =  "double";
   break;
  case "adDecimal":
   FdType =  "decimal";
   break;
  case  "adDBDate":
   FdType =  "date";
   break;
  case  "adDBTime":
   FdType =  "time";
   break;
  case  "adDBTimeStamp":
   FdType =  "datetime";
   break;
  case  "adChar":
   FdType =  "char";
   break;
  case  "adVarChar":
   FdType =  "varchar";
   break;
  case  "adLongVarChar":
   FdType =  "text";
   break;
  case  "adBinary":
   FdType =  "tinyblob";
   break;
  case  "adVarBinary":
   FdType =  "mediumblob";
   break;
  case  "adLongVarBinary":
   FdType =  "longblob";
   break;
   default:
   FdType =  "Error:";
   }
  } else if ( dbms == "Oracle" ) {  //4
  switch (  adoType ) {
  case  "adTinyInt":
   FdType =  "NUMBER(3,0)"
   break;
  case  "adSmallInt":
   FdType =  "SMALLINT";
   break;
  case  "adInteger":
   FdType =  "INT";
   break;
  case  "adBigInt":
   FdType =  "NUMBER";
   break;
  case  "adSingle":
   FdType =  "REAL";
   break;
  case  "adDouble":
   FdType =  "FLOAT";
   break;
  case  "adNumeric":
   FdType =  "NUMBER";
   break;
  case  "adBoolean":
   FdType =  "NUMBER(1,0)";
   break;
  case  "adDBTimeStamp":
   FdType =  "DATE";
   break;
  case  "adChar":
   FdType =  "CHAR";
   break;
  case  "adVarChar":
   FdType =  "VARCHAR2";
   break
  case  "adLongVarChar":
   FdType =  "LONG";
   break;
  case  "adVarBinary":
   FdType =  "RAW";
   break;
  case  "adLongVarBinary":
   FdType = "LONG  RAW";
   default:
   FdType =  "Error:";
   }
  } else if ( dbms == "Sybase" ) {  //5
  switch (  adoType ) {
  case  "adTinyInt":
   FdType =  "tinyint"
   break;
  case  "adSmallInt":
   FdType =  "smallint";
   break;
  case  "adInteger":
   FdType =  "int";
   break;
  case  "adSingle":
   FdType =  "real";
   break;
  case  "adDouble":
   FdType =  "float";
   break;
  case  "adCurrency":
   FdType =  "money";
   break;
  case  "adDecimal":
   FdType =  "decimal";
   break;
  case  "adNumeric":
   FdType =  "numeric";
   break;
  case  "adBoolean":
   FdType =  "bit";
   break;
  case  "adDBTimeStamp":
   FdType =  "datetime";
   break;
  case  "adChar":
   FdType =  "char";
   break;
  case  "adVarChar":
   FdType =  "varchar";
   break;
  case  "adLongVarChar":
   FdType =  "text";
   break;
  case  "adBinary":
   FdType =  "binary";
   break;
  case  "adVarBinary":
   FdType =  "varbinary";
   break;
  case  "adLongVarBinary":
   FdType =  "image";
   break;
   default:
   FdType =  "Error:";
   }
  } else if ( dbms == "Informix" ) {  //6
  switch (  adoType ) {
  case  "adSmallInt":
   FdType =  "smallint";
   break;
  case  "adInteger":
   FdType =  "integer";
   break;
  case  "adSingle":
   FdType =  "smallfloat";
   break;
  case  "adDouble":
   FdType =  "float";
   break;
  case  "adDecimal":
   FdType =  "decimal";
   break;
  case  "adNumeric":
   FdType =  "numeric";
   break;
  case  "adDBDate":
   FdType =  "date";
   break;
  case  "adDBTimeStamp":
   FdType =  "datetime";
   break;
  case  "adChar":
   FdType =  "char";
   break;
  case  "adVarChar":
   FdType =  "varchar";
   break;
  case  "adWChar":
   FdType =  "nchar";
   break;
  case  "adVarWChar":
   FdType =  "nvarchar";
   break;
  case  "adLongVarBinary":
   FdType = "byte";
   default:
   FdType =  "Error:";
   }
  } else if ( dbms == "Cloudscape" ) {  //7
  switch (  adoType ) {
  case  "adTinyInt":
   FdType =  "TINYINT"
   break;
  case  "adSmallInt":
   FdType =  "SMALLINT";
   break;
  case  "adInteger":
   FdType =  "INT";
   break;
  case  "adBigInt":
   FdType =  "LONGINT";
   break;
  case  "adSingle":
   FdType =  "REAL";
   break;
  case  "adDouble":
   FdType = "DOUBLE  PRECISION";
   break;
  case  "adDecimal":
   FdType =  "DECIMAL";
   break;
  case  "adNumeric":
   FdType =  "NUMERIC";
   break;
  case  "adBoolean":
   FdType =  "BOOLEAN";
   break;
  case  "adDBDate":
   FdType =  "DATE";
   break;
  case  "adDBTime":
   FdType =  "TIME";
   break;
  case  "adDBTimeStamp":
   FdType =  "TIMESTAMP";
   break;
  case  "adChar":
   FdType =  "CHAR";
   break;
  case  "adVarChar":
   FdType =  "VARCHAR";
   break;
  case  "adLongVarChar":
   FdType = "LONG  VARCHAR";
   break;
  case  "adBinary":
   FdType =  "BIT";
   break;
  case  "adVarBinary":
   FdType = "BIT  VARYING";
   break;
  case  "adLongVarBinary":
   FdType = "LONG BIT  VARYING";
   default:
   FdType =  "Error:";
   }
  } else if ( dbms == "Postgres" ) {  //8
  switch (  adoType ) {
  case  "adSmallInt":
   FdType =  "int2";
   break;
  case  "adInteger":
   FdType =  "ing4";
   break;
  case  "adBigInt":
   FdType =  "ing8";
   break;
  case  "adSingle":
   FdType =  "float4";
   break;
  case  "adDouble":
   FdType =  "float8";
   break;
  case  "adCurrency":
   FdType =  "money";
   break;
  case  "adBoolean":
   FdType =  "bool";
   break;
  case  "adDBDate":
   FdType =  "date";
   break;
  case  "adDBTime":
   FdType =  "time";
   break;
  case  "adDBTimeStamp":
   FdType =  "timestamp";
   break;
  case  "adChar":
   FdType =  "char";
   break;
  case  "adVarChar":
   FdType =  "varchar";
   break;
  case  "adLongVarChar":
   FdType = "text";
   default:
   FdType =  "Error:";
   }
  } else if ( dbms == "MiniSQL" ) {  //9
  }
  return  FdType;
  }

  function addIndex_onClick(){
   // check index name
  var name =  document.form1.idxName.value;
  if (name.length  < 0){
   alert("Index name is required.");
   return;
  }
  ch  = name.charAt(0);
  if (ch < 'A' || (ch  > 'Z' && ch < 'a') || ch > 'z')     {
  alert("Invalid index name.");
   return;
  } 
   for (i = 0; i < name.length; i++)  {
  ch =  name.charAt(i);
   if ( (ch < '0' || (ch > '9' && ch < 'A') || (ch  >    'Z' && ch < 'a') || ch > 'z') && ch != '_'  ){
   alert("Invalid index name.");
   return;
   }
  }
  //check  field for index.
  name =  document.form1.idxFields.value;
  if  (name.length <  1){
  alert("No field name for index.");
   return;
  }
   document.form1.SQLsentence.value =  AddIndexSQL();
   document.form1.submit();
  }

function  AddIndexSQL(){
  bUnique =  document.form1.unique.value;

 if ( dbms ==  "Cloudscape" ) {
   if (bUnique == "" || bUnique == "n" || bUnique ==     "N")
   CreateIdxSQL = "CREATE BTREE INDEX  ";
   else
   CreateIdxSQL = "CREATE UNIQUE BTREE INDEX ";
  }  else {
  if  (bUnique == "" || bUnique == "n" || bUnique ==     "N")
   CreateIdxSQL = "CREATE INDEX  ";
   else
   CreateIdxSQL = "CREATE UNIQUE INDEX ";
   }
  CreateIdxSQL = CreateIdxSQL +  document.form1.idxName.value + " ON <%=tbName%>    (" +  document.form1.idxFields.value;
   
  CreateIdxSQL = CreateIdxSQL.substring(0,  CreateIdxSQL.length - 1);
  CreateIdxSQL =  CreateIdxSQL + ")";

 return  CreateIdxSQL;
  }

function  ridIndex_onClick(){
  list =  document.form1.listIndex;
  var selidx =  list.selectedIndex;
  if ( selidx < 0  || selidx >= list.length  )
   return;

 switch ( dbms  ){
  case  "SQLServer":
  case  "Sybase":
  str =  "DROP INDEX <%=tbName%>." +  list.options[selidx].text;
   break;
  case  "Access":
  str =  "DROP INDEX " + list.options[selidx].text + " ON <%=tbName%>";
   break;
  case  "MySQL":
  case  "Oracle":
  case  "Informix":
  case  "Cloudscape":
  case "MiniSQL":  
  case "Postgres":  
  str = "DROP  INDEX " +  list.options[selidx].text;
   break;
   default:
  str =  "";
  }
   document.form1.SQLsentence.value = str;
   document.form1.submit();
  }


  function  listName_onChange(){
  NameIdx =  document.form1.listName.selectedIndex;

  document.form1.listType.selectedIndex =  NameIdx;
  document.form1.listSize.selectedIndex  = NameIdx;
  }

function  listType_onChange(){
  TypeIdx =  document.form1.listType.selectedIndex;

  document.form1.listName.selectedIndex =  TypeIdx;
  document.form1.listSize.selectedIndex  = TypeIdx;
  }

function  listSize_onChange(){
  SizeIdx =  document.form1.listSize.selectedIndex;

  document.form1.listType.selectedIndex =  SizeIdx;
  document.form1.listName.selectedIndex  = SizeIdx;
  }

function  listFields_onChange(){
  var  tmp1,tmp2;
   document.form1.listName.selectedIndex = -1
   document.form1.listType.selectedIndex = -1;
   document.form1.listSize.selectedIndex = -1;
   
  selidx =  document.form1.listFields.selectedIndex;
  if (  selidx > -1 && selidx < document.form1.listFields.length    )  {
  tmp1 =  document.form1.idxFields.value;
   tmp2 =  document.form1.listFields.options[selidx].text;

  if (tmp2 != "")  {
   if (tmp1.indexOf(" " + tmp2 + ",") == -1)  {
   document.form1.idxFields.value = tmp1 + " " + tmp2 +  ",";
   }
   }
  }
   document.form1.listFields.selectedIndex = -1;
  }
</SCRIPT>
</HEAD>
<BODY  bgcolor=Lavender>
<%
if  Request.Form("ticker").count > 0 then
 tbName = Request.Form("ticker")
else
tbName  = Request.QueryString("ticker")
end if

if Request.Form("SQLsentence")  <> "" then
  Session("webConn").Execute  Request.Form("SQLsentence")
  end if

arr4 = Array(null, null, tbName,  null)
  set REC = Session("webConn").OpenSchema(20, arr4)
  schem =  REC.fields.item(0)
  cotag = REC.fields.item(1)
  REC.close

set RS =  Session("webConn").Execute( "SELECT * FROM "    & tbName )
  fdCnt =  RS.Fields.Count
  dim nameArr()
  redim nameArr(fdCnt - 1)

function  TypeStr(fdType)
  select case  fdType
  case 0  'adEmpty
   TypeStr =  "adEmpty"
  case  16  'adTinyInt
   TypeStr =  "adTinyInt"
  case  2  'adSmallInt
   TypeStr =  "adSmallInt"
   case 3  'adInteger
   TypeStr =  "adInteger"
  case  20  'adBigInt
   TypeStr =  "adBigInt"
  case  17  'adUnsignedTinyInt
   TypeStr =  "adUnsignedTinyInt"
   case 18  'adUnsignedSmallInt
   TypeStr =  "adUnsignedSmallInt"
   case 19  'adUnsignedInt
   TypeStr =  "adUnsignedInt"
   case 21  'adUnsignedBigInt
   TypeStr =  "adUnsignedBigInt"
   case 4  'adSingle
   TypeStr =  "adSingle"
  case  5  'adDouble
   TypeStr =  "adDouble"
  case  6  'dCurrency
   TypeStr =  "adCurrency"
   case 14  'adDecimal
   TypeStr =  "adDecimal"
  case  131  'adNumeric
   TypeStr =  "adNumeric"
  case  11  'adBoolean
   TypeStr =  "adBoolean"
  case  10  'adError
   TypeStr =  "adError"
  case  132  'adUserDefined
   TypeStr =  "adUserDefined"
   case 12 'adVariant  
   TypeStr =  "adVariant"
  case  9 'adIDispatch  
   TypeStr =  "adIDispatch"
   case 13  'adIUnknown
   TypeStr =  "adIUnknown"
   case 72  'adGUID
   TypeStr =  "adGUID"
  case 7  'adDate
   TypeStr =  "adDate"
  case  133  'adDBDate
   TypeStr =  "adDBDate"
  case  134  'adDBTime
   TypeStr =  "adDBTime"
  case  135  'adDBTimeStamp
   TypeStr =  "adDBTimeStamp"
   case 8 'adBSTR  
   TypeStr =  "adBSTR"
  case  129  'adChar
   TypeStr =  "adChar"
  case  200  'adVarChar
   TypeStr =  "adVarChar"
  case  201  'adLongVarChar
   TypeStr =  "adLongVarChar"
   case 130  'adWChar
   TypeStr =  "adWChar"
  case  202  'adVarWChar
   TypeStr =  "adVarWChar"
   case 203  'adLongVarWChar
   TypeStr =  "adLongVarWChar"
   case 128  'adBinary
   TypeStr =  "adBinary"
  case  204  'adVarBinary
   TypeStr =  "adVarBinary"
   case 205 'adLongVarBinary  
   TypeStr = "adLongVarBinary"
  end select
  end  function
  dbms = Request.QueryString("dbms")
  %>

  <FORM  method=POST action="designtb.asp?dbms=<%=dbms%>&ticker=<%=tbName%>" name="form1">
  <TABLE border=0  cellspacing=0 cellpadding=0>
  <TR><TD  valign=top>
   <TABLE><TR><TD><b>Table Name: [ </b><%=tbName%><b> ]</b></TD></TR></TABLE>

  <TABLE><TR>
   <TD><font  size=1><b>Name:</b></font><BR><INPUT type=textbox  name=fdName  value=""></TD>
   <TD><font  size=1><b>Type:</b></font><BR><SELECT name=fdType  width=150 style="WIDTH: 150"  onchange="ChgType()">
   <OPTION  value=0>adEmpty
   <OPTION  value=1>adTinyInt
   <OPTION  value=2>adSmallInt
   <OPTION  value=3>adInteger
   <OPTION  value=4>adBigInt
   <OPTION  value=5>adUnsignedTinyInt
   <OPTION  value=6>adUnsignedSmallInt
   <OPTION  value=7>adUnsignedInt
   <OPTION  value=8>adUnsignedBigInt
   <OPTION  value=9>adSingle
   <OPTION  value=10>adDouble
   <OPTION  value=11>adCurrency
   <OPTION  value=12>adDecimal
   <OPTION  value=13>adNumeric
   <OPTION  value=14>adBoolean
   <OPTION  value=15>adError
   <OPTION  value=16>adUserDefined
   <OPTION value=17>adVariant  
   <OPTION value=18>adIDispatch  
   <OPTION value=19>adIUnknown  
   <OPTION  value=20>adGUID
   <OPTION value=21>adDate  
   <OPTION value=22>adDBDate  
   <OPTION  value=23>adDBTime
   <OPTION value=24>adDBTimeStamp  
   <OPTION value=25>adBSTR  
   <OPTION value=26>adChar  
   <OPTION value=27  selected>adVarChar
   <OPTION  value=28>adLongVarChar
   <OPTION  value=29>adWChar
   <OPTION  value=30>adVarWChar
   <OPTION  value=31>adLongVarWChar
   <OPTION  value=32>adBinary
   <OPTION  value=33>adVarBinary
   <OPTION value=34>adLongVarBinary  
   </SELECT></TD>
   <TD><font size=1><b>Size</b> or  [<b>Precision</b>,<b>scale</b>]<b>:</b></font><BR>
   <INPUT type=textbox name=fdSize value=50  size=16></TD>
   </TR></TABLE>

  <TABLE><TR>
   <TD><INPUT name=addField type=button value="Add Field " onClick="addField_onClick();"></TD>
   <TD><INPUT name=ridField type=button value="Remove Field" onClick="ridField_onClick();"></TD>
   </TR></TABLE>

  <TABLE><TR>
   <TD><SELECT name=listName size=11 WIDTH=150 style="WIDTH: 150" onChange="listName_onChange();">
  <%  for i = 0 to fdCnt -  1
   nameArr(i) =  RS.Fields(i).Name%>

   <OPTION><%=nameArr(i)%></OPTION>
  <%  next%>
   </SELECT></TD>
   <TD><SELECT name=listType size=11 WIDTH=150 style="WIDTH: 150" onChange="listType_onChange();">
  <%  for i = 0 to fdCnt -  1%>
   <OPTION><%=TypeStr( RS.Fields(i).Type  )%>
</OPTION>
  <%  next%>
   </SELECT></TD>
   <TD><SELECT name=listSize size=11 WIDTH=130 style="WIDTH: 130" onChange="listSize_onChange();">
  <%  for i = 0 to fdCnt -  1%>
   <OPTION><%=RS.Fields(i).DefinedSize%></OPTION>
  <%  next%>
   </SELECT></TD>
   <TD  width=10> </TD>
   </TR></TABLE>
   </TD>
   <TD>
   <TABLE>
   <TR><TD><font size=1><B>Indexes:</B></font><BR>
   <SELECT name=listIndex size=4 width=180 style="WIDTH: 180">
  <%  RS.Close
   arr5 = Array(schem, cotag, null, null,  tbName)
   set REC = Session("webConn").OpenSchema(12,  arr5)
   temp =  ""
   while not  REC.Eof
   set idxName =  REC.Fields("INDEX_NAME")
   if not isEmpty(idxName.Value) and temp <> idxName.Value  then%>

   <OPTION><%=idxName.Value%>
  <%  temp =  idxName.Value
   end  if
   REC.MoveNext
   wend
   REC.close%>

   </SELECT><BR>
   <INPUT name=addIndex type=button value="Add Index" onClick="addIndex_onClick();">
   <INPUT name=ridIndex type=button value="Del Index" onClick="ridIndex_onClick();">
   </TD></TR>

  <TR><TD><font size=1><B>Index  Name:</B></font><BR>
   <INPUT name=idxName size=16  value=""> 
   <INPUT name=unique type=textbox size=1  value=""> Unique (<B>y</B>/<B>n</B>)</TD>
   </TR>

  <TR><TD><font size=1><B>Available  Fields:</B></font><BR>
   <SELECT name=listFields size=4 width=180 style="WIDTH: 180" onChange="listFields_onChange();">
  <%  for i = 0 to fdCnt -  1%>
   <OPTION><%=nameArr(i)%></OPTION>
  <%  next%>
   </SELECT>
   </TD></TR>

  <TR><TD><font size=1><B>Indexed  fields:</B><font><BR>
   <INPUT type=textbox name=idxFields size=23  value="">
   </TD></TR>
   </TABLE>
   </TD></TR></TABLE>
  <input  name="SQLsentence" type=hidden  size=4>
  </FORM>
</BODY>
</HTML>

 


Copyright © 1998-2002, Halcyon Software Inc. All rights reserved.