东风风行赵彬侠:asp+access中如何实现创建临时表查询?

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/01 00:20:57
sql="select * into #temptable from table where (search conditions)"
set rs= Server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3

在asp中使用类似于以上条件的查询时报错,提示说“SELECT 子句中包含一个保留字、拼写错误或丢失的参数,或标点符号不正确。”
请问高手该如何在asp中建立临时表查询?

Access不支持临时表。

如果你要使用临时表可以用:
conn.execute "create table 表名 ....."
来建立表,用完以后用:
conn.execute "drop table 表名"
来删除该表。