Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADO is read only in MS Data Grid Control
Message
From
17/11/2000 14:03:52
Jorge Haro
Independent Consultant
Juarez, Mexico
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00443155
Message ID:
00443164
Views:
16
Hi Paul, I tried the code with slight changes to open an SQL server database, and it works fine allowing me to edit records. Have you changed the Allow Updates property of the grid?, this would keep you from editing the records from within the grid.

BTW, I'm also working with ADO, and I'd love to have someone to exchange tips with. I got the MS Data Grid working but I need to remove trailing spaces manually whenever I edit text, as in hitting the delete key or else it generates an error, I haven't found a programmatic way to do it. Let me know if you run into this.

>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
Map
View

Click here to load this message in the networking platform