日期:2014-05-17  浏览次数:20824 次

如何用ODBC连接数据库来删除表中记录
各位大哥,请帮个忙,我想用在ODBC中设置DSN的方法来访问数据库,比如实现增加,删除,修改的功能,该怎么办啊,请给指点指点啊,谢谢了!

------解决方案--------------------
<%
Set conn = CreateObject( "ADODB.Connection ")
conn.open "DSN_NAME "
sql = "INSERT INTO tbl(xx,xx,xx) VALUES( 'xx ', 'xx ',123) "
conn.execute sql
sql = "UPDATE tbl SET xxx= 'xxx ' WHERE xx=123 "
conn.execute sql
sql = "DELECT FROM tbl WHERE xx=123 "
conn.execute sql
coon.close
Set conn= Nothing
%>