模拟退火算法应用案例:如何解释这段代码?

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/11 04:06:42
Sub OpenRs(ByVal SqlStr)
If Left(LCase(SqlStr),6)="select" Then
Rs.Open SqlStr,Conn,1,3
Else
Conn.Execute SqlStr
End If
End Sub

Left(LCase(SqlStr),6)="select" 判断sql语句是查询操作还是插入或者更新
select操作需要返回记录集 所以用rs记录集打开

其他 insert update 不用返回记录集 可以直接用connection对象执行