您的位置首页百科问答

ASP与SQL的

ASP与SQL的

<%SQLServerName = "" '服务器名称或地辩旁址 如本地 (local)SQLDBUserName = "" '数据库帐号SQLDBPassword = "" '数据库密码SQLDBName = "" '数据库名称 Set conn = Server.CreateObject("ADODB.Connection")conn.Open"Provider=sqloledb;user id="&SQLDBUserName&";password="&SQLDBPassword&";initial catalog="&SQLDBName&";data source="&SQLServerName&";"添加记录conn.execute("insert into table([字段1],[字段2]....) values('"&值1&森灶"','"&值2&"'....)")删除记录conn.execute("delete from [table] where 字段='"&值&"'")更新记录conn.execute("update [table] set where 字段1='"&值1&"' where 字段2='"&值2&"此灶扮'")%>