You can't set the cursor type with the Execute method of the Connection object but you can set the location. By default this will result in an adOpenStatic cursor type, which is fine. On second thought it may depend on which provider you are using, so you better check or make life easier and use the Recordset.Open method.
VB Code:
Dim objCon as ADODB.Connection Dim objRS as ADODB.Recordset Set objCon = New ADODB.Connection objCon.CursorLocation = adUseClient objCon.Open "provider=..." Set objRs = objCon.Execute(strSQL) 'or use the open method instead Set objRs = New ADODB.Recordset objRs.CursorLocation = adUseClient objRs.Open strSQL, objCon, adOpenStatic, adLockReadOnly,adCmdText




Reply With Quote