Hi, I am trying to build an ADO command connect to a recordset. This is my code:
Public CommandX as New ADODB.Command
Public RecordsetX as New ADODB.Recordset
Dim SQL as string
Set CommandX.ActiveConnection = another_form.ConnectionX
("ConnectionX" is a connection object defined in another form as public, so now when I want to refer to it I have to type another_form.ConnectionX)
SQL = "Select * From <anyTable>"
CommandX.CommandText = SQL
CommandX.CommandType = adCmdStoredProc
Set RecordsetX = CommandX.Execute
During test running, when the program reachs lines like this one:
> RecordsetX.AbsolutePosition = 1 <
There will be error message saying bookmarks are not supported.
So I copy these lines from the reference book:
RecordsetX.CursorLocation = adUseClient
RecordsetX.CursorType = adOpenDynamic
RecordsetX.LockType = adLockOptimistic
but still the same result.
When I work with recordset alone the absoluteposition thing works fine, but not anymore when I am having commands involved. Is there anything wrong in the code?
Public CommandX as New ADODB.Command
Public RecordsetX as New ADODB.Recordset
Dim SQL as string
Set CommandX.ActiveConnection = another_form.ConnectionX
("ConnectionX" is a connection object defined in another form as public, so now when I want to refer to it I have to type another_form.ConnectionX)
SQL = "Select * From <anyTable>"
CommandX.CommandText = SQL
CommandX.CommandType = adCmdStoredProc
Set RecordsetX = CommandX.Execute
During test running, when the program reachs lines like this one:
> RecordsetX.AbsolutePosition = 1 <
There will be error message saying bookmarks are not supported.
So I copy these lines from the reference book:
RecordsetX.CursorLocation = adUseClient
RecordsetX.CursorType = adOpenDynamic
RecordsetX.LockType = adLockOptimistic
but still the same result.
When I work with recordset alone the absoluteposition thing works fine, but not anymore when I am having commands involved. Is there anything wrong in the code?