asp 一个页面多次连接数据库时出错,求高手帮忙!

asp 一个页面多次连接数据库时出错,求高手帮忙!,第1张

ip

一般这个应该是ID...你查下你的contents 的自动编号的ID,是不是你里面所写的排序为IP

也就是说,应该写成select * from contents order by ID desc...

如果不是这个错,请追问。

封装 SqlConnection,定义成Static ,或者用singleton

public class CustomisedConnection

{

public static CustomisedConnection ConnectionInstance = new CustomisedConnection()

SqlConnection _conn

private CustomisedConnection(){_conn = new SqlConnection()}

}

调用CustomisedConnection.ConnectionInstance 就好了

添加一个模块,添加引用,Microsoft ActiveX Data Object 2.0 Library 把下面这些放入模块中

Dim mycon As New ADODB.Connection

Dim myrs As New ADODB.Recordset

还不行,你就把myrs.Open "authors", mycon, adOpenStatic, adLockOptimistic, adCmdTableDirect

改为

myrs.Open "authors", mycon, 3,1


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/9413592.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-28
下一篇 2023-04-28

发表评论

登录后才能评论

评论列表(0条)

保存