bt50刀柄锥度是多少:vb中这段代码对不?是什么意思

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/30 16:47:56
Public Function Gettime() As Date '取服务器时间
Dim rs As New ADODB.Recordset
Set rs = "select getdate() as dd", CN, adOpenKeyset, adLockOptimistic, adCmdText
If rs.RecordCount > 0 Then Gettime = rs.Fields(0).Value
rs.Close
End Function

为什么这名话出错: Set rs = "select getdate() as dd", CN, adOpenKeyset,

不对:
Set rs = "select getdate() as dd", CN, adOpenKeyset, adLockOptimistic, adCmdText
这句是错的。应为:
rs.Open "select getdate() as dd", CN, adOpenKeyset, adLockOptimistic, adCmdText

在这一句Set rs = "select getdate() as dd"...之前加一上句:
Set rs = New ADODB.Recordset

试试吧

在这一句Set rs = "select getdate() as dd"...之前加一上句:
Set rs = New ADODB.Recordset

试试吧

回答者:bluebell_dz - 秀才 二级 8-4 11:14

这样就更错了,不要听的,自己再好好看看吧!