Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grids and SQL Server
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01223538
Message ID:
01223549
Views:
13
>I'm running into a weird issue and I just can't seem to track it down.
>
>I've got a form with two grids on it. In the Load() event of the form, I instanciate an object which connects to SQL Server, and pulls down two different cursors. One grid shows the parent records, the other grid shows the children for the selected parent. In the AfterRowColChange event, I refresh the child cursor from SQL server. As expected, this blows away the RecordSource of the child grid.
>
>I've got two methods in my grid classes to save/restore this info to handle this issue, and I usually have code that looks like this:
>
>
>ThisForm.grdDetail.SaveSource()
>
>ThisForm.oBizObj.GetDetail()
>
>ThisForm.grdDetail.RestoreSource()
>
>
>However, in this case, as soon as the SQLEXEC is run in the GetDetail() method (well, in my SQL object called by this method), it blows away the RecordSource for the Parent grid. If I check the code, it's definitely only refreshing the detail cursor. If I check the records in the parent cursor, they're still all there (so this cursor isn't getting closed).
>
>I created a simple form to see if I could reproduce the problem w/the base classes. I thought it may have something to do with the length of the cursor name, so I shortened it up to under 10 characters. It suddenly started working. So I changed it back to the longer name. It still works. I tried the same on my real form w/no luck.
>
>I've tried a default datasession vs a private datasession form, w/no difference. I can run each form back to back, one will work, the other will fail (I'd think if it were environment settings it would show up here).
>
>I created a
>
>BTW - I'm just using the terms parent/child to make this a bit easier to understand. There isn't any relationship set-up in the grid or via SET RELATION.
>
>Any thoughts or ideas?

Take a look at Message # 1161808 (I love this solution)
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Previous
Reply
Map
View

Click here to load this message in the networking platform