General information
Category:
ActiveX controls in VFP
What are the properties of the DSN and the data control? It's been long since I've used the data control, but it has properties for the recordset that may be overwriting the ones you are setting.
I would do away with the data control. You can just assign the ADO recordset to the recorsource property.
>Hi:
>
>I cannot get the MS Data Grid control to allow updates using and ADO connection. All the data and columns show up in the grid, but I cannot enter any changes into the grid.
>
>I have verified that the ADO recordset can update the backend via changing individual values.
>
>My backend data source is Foxpro 2.x tables
>
>Most of this code sample comes from the Client/Server Applications with Visual Foxpro and SQL Server from Hentzenwerke chapter 12.
>
>Here is my code:
>
>#DEFINE adOpenStatic 3
>#DEFINE adLockOptimistic 3
>
>*
>* Create ADO objects
>*
>Thisform.oConnection = CreateObject("adodb.connection")
>Thisform.oRecordSet = CreateObject("adodb.recordset")
>
>*
>* Open the DSN connection to FoxPro 2.x tables
>*
>Thisform.oConnection.Open("MyDSN")
>
>*
>* Get the ADO recordset
>*
>Thisform.oRecordSet.Open("Select * From SomeTable",Thisform.oConnection,adOpenStatic,adLockOptimistic)
>
>*
>* Set the Microsoft ADO Data Control properties
>*
>ThisForm.oleDataCtrl.object.Recordset = Thisform.oRecordSet
>ThisForm.oleDataCtrl.object.Refresh()
>
>*
>* Set the Microsoft Grid Control (OLEDB) Ver 6.0 properties
>*
>ThisForm.oleGrid.object.DataSource = ThisForm.oleDataCtrl.object
>ThisForm.oleGrid.object.Refresh()
>
>Anybody have a clue what I'm doing wrong?
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only