OleDb连接字符串生成器

OleDb连接字符串生成器

<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>

你可能感兴趣的:(OleDb连接字符串生成器)