<html>
<body>
<input type="button" language="jscript" onclick="donew();" value="new">
<input type="button" language="jscript" onclick="doedit();" value="edit">
<br>
<label for="cns">connection string:</label><br>
<textarea id="cns" cols="50" rows="5" wrap="soft">
</textarea>
</body>
</html>
<script language="jscript">
/*====================================
    AUTHOR: Lux21
====================================*/

var obj_dl;

obj_dl = new ActiveXObject("datalinks");

function donew()
{
    var obj_cn;
   
    obj_cn = obj_dl.PromptNew();
    if (obj_cn != null)
    {
        cns.innerText = obj_cn.ConnectionString;
    }
}

function doedit()
{
    var obj_cn;
   
    obj_cn = new ActiveXObject("adodb.connection");
    obj_cn.ConnectionString = cns.innerText;
    if (obj_dl.PromptEdit(obj_cn))
    {
        cns.innerText = obj_cn.ConnectionString;
    }
}
</script>

posted on 2009-08-26 09:30  bestsaler  阅读(130)  评论(0编辑  收藏  举报