上个方法不好,,,,有专门的返回计算值的方法,,,就是这个ExecuteScalar    代码少了不少

Dim strConn, strSQL As String
Dim myConn As OleDbConnection
Dim myCommand As OleDbCommand
dim cont as integer
strsql = "select * from table"
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(".") & "/db1.mdb"
myConn = New OleDbConnection(strConn)
myCommand = New OleDbCommand(strSQL, myConn)
myConn.Open()
cont = myCommand.ExecuteScalar()
myConn.Close()
response.write(CONT)

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2021-11-22
  • 2022-03-01
  • 2022-12-23
  • 2022-12-23
  • 2021-09-17
猜你喜欢
  • 2021-11-05
  • 2021-08-16
  • 2022-12-23
  • 2021-09-07
  • 2021-12-31
  • 2021-10-27
  • 2022-12-23
相关资源
相似解决方案