请问如何用在asp中用conn.excute的方法清空一个数据表? (100分)

  • 主题发起人 主题发起人 downage
  • 开始时间 开始时间
D

downage

Unregistered / Unconfirmed
GUEST, unregistred user!
请给出完整语句,谢谢!
 
ADOQuery1.sql.close;
ADOQuery1.sql.clear;
ADOQuery1.sql.add('delete from tablename')
ADOQuery1.execute;
 
没错,用上面的方法就行了
 
大哥们,我用asp!!
 
conn.excute("delete from tablename")
 
db="logo.mdb"
ConnStr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " &
Server.MapPath(db)
set conn=server.createobject("ADODB.connection")
conn.open connstr
sql="delete from logo"
set rs=conn.excute(sql)
难道这样不对么?
 
下面修改是正确的执行:
Provider = "Provider = Microsoft.Jet.OLEDB.4.0;"
DBN = Provider &"Data Source="&
Server.MapPath("Sample.mdb")
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open DBN &";Jet OLEDB:Database Password="&
Pssword
Set Cmd = Server.CreateObject("ADODB.Command")
Set Cmd.activeConnection = Conn
Cmd.Commandtext = "Delete From YouTable"
Cmd.Execute
 
后退
顶部