I believe topci is German (the comma separation of subordinate clauses as in "I hope, this will work" gives me this idea), and I'm sure his English is much better than my German, so this isn't a criticism. However, there are several misspellings in the code, which will not work as is. (adopendynamic, additem)
Also, he's telling you how to do it without the data control, using an ADO Recordset instead. I prefer this method as well. I don't like the data control and I don't like data binding either, unless I'm not trying to update anything. However, here are the steps to make the Data Control work with the DataGrid Control:
On the ADO Data Control:
1. Set the Connectionstring property to a valid connection of some sort. "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\Microsoft Visual Studio\VB98\NWIND.MDB;Persist Security Info=False" sets the string to the Northwind Database that ships with Visual Studio 6.
will give you numerous examples, too, and you can use the builder to help you as well (just hit the ... by the ConnectionString property in the Data control).
2. Set the RecordSource property to your SQL string. I used "select * from customers".
With the DataGrid control:
1. Set the DataSource property to your ADO Data Control.
That's all there is to it. If you want help using a Recordset instead of a Data Control, post back.
This may be out to lunch (i.e. complete garbage) but ADODC1 looks like an ADO data control but DBGrid1 is the default name usually assigned to a DAO data grid control. If you are attempting to assign an ADO record source (i.e. ADODB1) to a DBGrid control note that the two are incompatible. You need to use a DataGrid control Microsoft Data Grid Control 6.0 (SP6) (OLEDB)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.