Click here to Skip to main content
15,885,782 members
Articles / Programming Languages / ASP

Online DB Administration

Rate me:
Please Sign up or sign in to vote.
3.88/5 (16 votes)
17 Mar 2003 236.3K   2.5K   58  
Online administration of your database. Create or modify tables, keys, and indexes. Edit or insert data.
<!-- b.func.asp             - copyright (c) 2001-2002 by Bj�rnar Henden http://www.bhenden.org/ -->
<script language=javascript runat=server>
function Out(s) {
	Response.Write(s);
}

function DebugOut(s) {
	Response.Write("<div style=\"background-color:#FFC0C0; border: 1px solid black; padding: 4px; margin:2px\">" + s + "</div>");
}

function GetFormValue(varname,vardef) {
	if(Request.Form(varname).Count==1)
		return Request.Form(varname).Item;
	else
		return vardef;
}

function PutFormValue(varname,varvalue) {
	Out("<input type=\"hidden\" name=\"" + varname + "\" value=\"" + varvalue + "\"/>\n");
}

function IsNull(v) {
	return ""+v == "null";
}

function GetAllowNullsEnum(i) {
	switch(i) {
	case adIndexNullsAllow:		return "Allow";
	case adIndexNullsDisallow:	return "Disallow";
	case adIndexNullsIgnore:	return "Ignore";
	case adIndexNullsIgnoreAny:	return "IgnoreAny";
	default: return ""+i;
	}
}

function GetKeyTypeEnum(i) {
	switch(i) {
	case adKeyPrimary:		return "Primary";
	case adKeyForeign:		return "Foreign";
	case adKeyUnique:		return "Unique";
	default: return ""+i;
	}
}

function GetRuleEnum(i) {
	switch(i) {
	case adRICascade:		return "Cascade";
	case adRINone:			return "None";
	case adRISetDefault:	return "SetDefault";
	case adRISetNull:		return "SetNull";
	default: return ""+i;
	}
}

function GetPropertyAttributesEnum(value) {
	var s = "";

	if(value & adPropNotSupported)	s += "NotSupported, ";
	if(value & adPropRequired)		s += "Required, ";
	if(value & adPropOptional)		s += "Optional, ";
	if(value & adPropRead)			s += "Read, ";
	if(value & adPropWrite)			s += "Write, ";

	if(s!="") s = s.slice(0,s.length-2);
	return s;
}

</script>

<script language=vbscript runat=server>
' I'll have to admit that VBScript is useful for something :)
function jsFormatDateTime(dato,fmt)
	'SetLocale(0)
	if IsNull(dato) then
		jsFormatDateTime = "&nbsp;"
	else
		jsFormatDateTime = FormatDateTime(CDate(dato),fmt)
	end if
end function
</script>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Norway Norway
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions