ASP连接SQLite数据库

要用ASP来操作SQLite数据库,先在服务器上安装SQLite的ODBC驱动程序,可到这个站点上下载安装:

http://www.ch-werner.de/sqliteodbc/

下边是一个SQLite数据库结构:
引用内容
Create TABLE admin(username text,age integer);
我们再来用ASP演示下如何对SQLite数据库进行记录的增、查、改、删操作:
程序代码
<%
Response.Buffer = False ‘不加此句可能出现”超过响应缓冲区限制”错误
Set conn = Server.CreateObject(“ADODB.Connection”)
Set rs = Server.CreateObject(“ADODB.RecordSet”)
conn.open “DRIVER={SQLite3 ODBC Driver};Database=F:\mzwucom\bbs\db1.db”
conn.execute(“insert into admin values(‘usera’,20)”)
‘conn.execute(“update admin set username=’kk’ where username=’usera’”)
‘conn.execute(“delete from admin where age=20″)
rs.open “select * from admin”,conn,1,1
Do while Not rs.Eof
Response.Write(rs(“username”) & “,” & rs(“age”) & “
”)
rs.movenext
Loop
rs.close
Set rs = Nothing
conn.close
Set conn = Nothing
%>



SQLLite Develper:SQLLite查询器

你可能感兴趣的:(ASP,Html5)