Merge BAC_DataSource.ObjectName and BAC_DataSource.SQLStatement into BAC_DataSource.RecordSource? #118
Replies: 5 comments
-
Let's see how this looks in the users code: Is this intuitive? |
Beta Was this translation helpful? Give feedback.
-
I think it's consistent. Examples:
Dim frm as Access.Form
Set frm = ..
frm.RecordSource = "tbl_DemoData"
frm.RecordSource = "qry_DemoData"
frm.RecordSource = "Select * from tbl_DemoData order by pkid desc"
Dim ctl as Access.Combobox ' or Listbox
Set ctl = ..
ctl.RowSource = "tbl_DemoData"
ctl.RowSource = "qry_DemoData"
ctl.RowSource = "Select * from tbl_DemoData order by pkid desc" Access.Chart also has the RowSource property. My main reason: |
Beta Was this translation helpful? Give feedback.
-
OK, good points. In Access VBA your code looks like this: With better Access Chart your code would look like this: That sounds weird to me. |
Beta Was this translation helpful? Give feedback.
-
Then let's find another name for Rowsource. ADODB.Command uses CommandText. The content can be an SQL statement or just a procedure name (Depending on CommandType property). Other (also not much better) names: Maybe with default property in DataSource class:
Object-oriented approach
But we're using VBA, so I'll drop that thought right away. [OT] |
Beta Was this translation helpful? Give feedback.
-
I think the default property approach is the best idea here. |
Beta Was this translation helpful? Give feedback.
-
Do the properties ObjectName and SQLStatement have a reason to be kept separate?
I think it would be easier to manage if only one property (similar to Form.RecordSource) is used.
Example: BAC_DataSource.getData
vs.
Beta Was this translation helpful? Give feedback.
All reactions