# Re: 有谁有vb6.0 用 cursor and sql server 范例

Posted by OCEAN on April 02, 1999 at 16:43:32:

In Reply to: 有谁有vb6.0 用 cursor and sql server 范例 posted by 炮笙 on March 31, 1999 at 15:50:27:

:
: 有谁有vb6.0 用 cursor and sql server 范例

Const sRDOString As String = ";DRIVER={SQL Server};SERVER=FINDBSR;DATABASE=FINDB"

Dim cn_f_sel As New rdoConnection
Dim sSQL As String

cn_f_sel.LoginTimeout = 0
cn_f_sel.CursorDriver = rdUseServer
cn_f_sel.Connect = sRDOString
cn_f_sel.EstablishConnection rdDriverNoPrompt
cn_f_sel.QueryTimeout = 180

cn_f_exe.BeginTrans
rdoErrors.Clear
cn_f_exe.Execute sSQL, rdExecDirect
If rdoErrors.Count <> 0 Then
cn_f_exe.RollbackTrans
Else
cn_f_exe.CommitTrans
End If

Follow Ups: