WalterHeisenberg
Technical User
- Mar 28, 2008
- 159
Hello,
First I'll make no attempt to hide I am an absolute beginner when it comes to VB. I've been given an application and asked to "enhance" it with no prior vb experience.
Thus far I've made the "eye candy" changes needed with various labels and check boxes etc. However, I cannot get the results of a SQL query to display in a datagrid using the DBGrid control. I have been able to display items in a listbox but ultimately I will need to get this datagrid working.
After building my query based on user input, I am using:
where sql is the SQL statement and cn is the connection string. Again, I can results to display in a label or listbox but can't get them to show on the datagrid. I tried adding, "set DBGrid.datasource = rst but get "class not support automation or does not support expected interface". Many thanks in advance for help!
First I'll make no attempt to hide I am an absolute beginner when it comes to VB. I've been given an application and asked to "enhance" it with no prior vb experience.
Thus far I've made the "eye candy" changes needed with various labels and check boxes etc. However, I cannot get the results of a SQL query to display in a datagrid using the DBGrid control. I have been able to display items in a listbox but ultimately I will need to get this datagrid working.
After building my query based on user input, I am using:
Code:
Set rst = New Adodb.Recordset
rst.Open sql, cn, adOpenStatic, adLockReadOnly, adCmdText
where sql is the SQL statement and cn is the connection string. Again, I can results to display in a label or listbox but can't get them to show on the datagrid. I tried adding, "set DBGrid.datasource = rst but get "class not support automation or does not support expected interface". Many thanks in advance for help!