- <html>
- <body>
- <inputtype="button"language="jscript"onclick="donew();"value="new">
- <inputtype="button"language="jscript"onclick="doedit();"value="edit">
- <br>
- <labelfor="cns">connectionstring:</label><br>
- <textareaid="cns"cols="50"rows="5"wrap="soft">
- </textarea>
- </body>
- </html>
- <scriptlanguage="jscript">
- /**//*====================================
- AUTHOR:Lux21
- ====================================*/
- varobj_dl;
- obj_dl=newActiveXObject("datalinks");
- functiondonew()
- {
- varobj_cn;
- obj_cn=obj_dl.PromptNew();
- if(obj_cn!=null)
- {
- cns.innerText=obj_cn.ConnectionString;
- }
- }
- functiondoedit()
- {
- varobj_cn;
- obj_cn=newActiveXObject("adodb.connection");
- obj_cn.ConnectionString=cns.innerText;
- if(obj_dl.PromptEdit(obj_cn))
- {
- cns.innerText=obj_cn.ConnectionString;
- }
- }
- </script>
From: http://www.cnblogs.com/freedom2130/archive/2005/09/07/231557.html
本文介绍了一种使用JavaScript来实现数据库连接字符串配置的方法。通过两个函数donew()和doedit(),用户可以新建或编辑数据库连接。示例中利用了ActiveX对象来操作连接属性。
154

被折叠的 条评论
为什么被折叠?



