当前位置:首页 > Sqlite > 正文内容

ASP操作SQLite数据库一例

canca15年前 (2011-05-23)Sqlite505
要用ASP来操作SQLite数据库,前提条件是在服务器上得安装SQLite的ODBC驱动程序,可到这个站点上下载安装:http://www.ch-werner.de/sqliteodbc/,安装好后就可以像使用Access一样来使用SQLite了!下边是一个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") & "<br/>")
    rs.movenext
Loop
rs.close
Set rs = Nothing
conn.close
Set conn = Nothing
%>


扫描二维码推送至手机访问。

版权声明:本文由Ant.Master's Blog发布,如需转载请注明出处。

本文链接:https://iant.work/post/252.html

标签: Sqlite
分享给朋友:
返回列表

没有更早的文章了...

下一篇:SQLite用SQL将纯真IP地址转16进制

“ASP操作SQLite数据库一例” 的相关文章

SQLite用SQL将纯真IP地址转16进制

SQLite将纯真IP地址转成16进制数,方便比较! SQLite 不支持 定义变量,无耐之下,只能这么杯具!! SQL如下: update main.qqips set ip_begin = ((substr(ip_begin,0,charindex('.',ip_begin)) * 255 *...

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。