MartyConnelly
martyconnelly at shaw.ca
Mon Oct 6 11:50:32 CDT 2003
I have only used the hirearchical flexgrid control. but you should be
able to fill it via following code
To create a udl file if you need it, open a blank file in notepad save
it as myudl.udl then double click in explorer.
Private Sub Form_Open(Cancel As Integer)
Dim cnNWind As New ADODB.Connection
Dim rsOrders As New ADODB.Recordset
Dim strConn As String
'set reference to ADO and/or change to OLEDB.4.00
strConn = "Provider=Microsoft.Jet.OLEDB.3.51;" & _
"Data Source=C:\Program Files\Microsoft
Office\Office\Samples\Northwind.mdb;"
'If using an Access 2000 mdb use "Microsoft.Jet.OLEDB.4.0"
cnNWind.CursorLocation = adUseClient
cnNWind.Open strConn
rsOrders.Open "SELECT OrderID, EmployeeID, OrderDate FROM Orders", _
cnNWind, adOpenStatic, adLockOptimistic, adCmdText
'assumes name of control DataGrid1 set recordset to control
Set DataGrid1.DataSource = rsOrders
End Sub
Darren DICK wrote:
>Hello all
>I have a need to insert the Microsoft DataGrid Control onto a form.
>the one that has a class of "MSDataGridLib.DataGrid.1" once you
>'drop' it onto a form
>The help wasn't and the MSDN developer Library is telling me I have to create
>a UDL connection to the database (It assumes VB only) Buggered if I know
>
>So...I need help with the usual stuff like populating it etc.
>
>Any takers? Any Gurus? Any resources?
>
>Many thanks
>Darren
>
>
>
>_______________________________________________
>AccessD mailing list
>AccessD at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/accessd
>Website: http://www.databaseadvisors.com
>
>
>