# What causes an Error 78 and/or sometimes "phantom" records in a browse?

**URL:** <https://clarionhub.com/t/what-causes-an-error-78-and-or-sometimes-phantom-records-in-a-browse/999>\
**Category:** Problem Tracker Support System\
**Created:** [February 19, 2017, 1:17am UTC](https://clarionhub.com/t/what-causes-an-error-78-and-or-sometimes-phantom-records-in-a-browse/999 "2017-02-19T01:17:35Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![brahn](https://clarionhub.com/user_avatar/clarionhub.com/brahn/32/756_2.png) [@brahn](https://clarionhub.com/u/brahn)\
**Post date:** [February 19, 2017, 1:17am UTC](https://clarionhub.com/t/what-causes-an-error-78-and-or-sometimes-phantom-records-in-a-browse/999/1 "2017-02-19T01:17:36Z")

</div>

Here is a reproduction of my old PTSS report. @Mark_Sarson might be able to describe the situation he found today with phantom records due to the same issue?

Clarion 8 PTSS - [Problem-Tracker Support System](http://problemtracker.softvelocity.com/clarion8/UpdtCustBugsview.php?ID1=39361)  
Clarion 9 PTSS - [Problem-Tracker Support System](http://problemtracker.softvelocity.com/clarion9/UpdtCustBugsview.php?ID1=39361)

* * *

**Problem Reference:** 39361  
**Date Received:** 2012-05-30  
**Status:** Opened for Review  
**Fixed in Build Number:**  
**Product:** Clarion8  
**Build No:** 89285  
**Operating System:**  
**Category ID:** ABC Classes

* * *

**Summary:** Variables used with return value from Position() are not large enough

**Description:**

The ABC Browse template and classes have a String(1024) declared to hold the return value from Position(). There are circumstances where this is not large enough.

When the templates/classes subsequently try to use a truncated saved position in a call to Reset or Reget an Error 78 is thrown.

**Steps to Reproduce:**

This is occurring on an SQL based view with several joined tables.

It is currently triggered when used in conjunction with the SortHeader extension/class.

Changing the browse template and classes to have a larger string stops the Error 78 from occuring.

I have marked this as reproducible=always but it does depend on view structure and data withing the view so it is also not always easy to reproduce.

Only tested in Clarion6 but Clarion7-8 have the same template/class string sizes.

**Reproducible:** Always  
**Severity:** Major  
**Visible to public:** Yes  
**Example App:** None submitted

---

<div class="post-metadata">

**Author:** ![Mark\_Sarson](https://clarionhub.com/user_avatar/clarionhub.com/mark_sarson/32/6132_2.png) [@Mark\_Sarson](https://clarionhub.com/u/Mark_Sarson)\
**Post date:** [March 30, 2017, 8:55am UTC](https://clarionhub.com/t/what-causes-an-error-78-and-or-sometimes-phantom-records-in-a-browse/999/2 "2017-03-30T08:55:56Z")

</div>

Our issue, which is caused by the same problem (Storage variables defined to store the POSITION(file.key) etc are not large enough @1024 characters.

The problem I had was with Browses that would have a column that is defined fairly large on the backend (In this case VARCHAR(512). Upon clicking the header to sort the browse in the order of that column, when I scrolled the scroll bar, we would see multiple rows with the same data.

This of course is a classic symptom of not using the pk filed in sort orders, however in our case we were using the primary field, so we could rule that out.

After searching the CLW’s, INC’s and TPx files I modified any local variables that were used to store position in the classes to ANY. There are also some fields in queues that needed modifying of their size.

Going through my diff’s these are the changes I made to correct this error.

```auto
###ABBrowse.clw
#####BrowseClass.ResetQueue PROCEDURE(BYTE RefreshMode)
HighlightedPosition from STRING(1024) to ANY

#####BrowseClass.UpdateViewRecord PROCEDURE
Pos from STRING(1024) to ANY

###ABFile.CLW
#####FileManager.UpdateServer PROCEDURE(BYTE HandleError)
HOLD from STRING(1024) to ANY

#####RelationManager.Delete PROCEDURE(BYTE Query)
Current:Position from STRING(1024) to ANY

###abvcrfrm.inc
VewPosition from String(1024) to STRING(10000)     

###ABVCRFRM.CLW

#####FormVCRClass.CheckBorders  
LastRecordPosition from STRING(1024) to ANY

#####FormVCRClass.Fetch
LastRecordPosition from STRING(1024) to ANY

###ABTblSyn.INC
DeletedRecordsQueue QUEUE,TYPE
RecordPosition STRING(10000)

###ABWindow.Inc
LastInsertedPosition from STRING(1024) to ANY

###ABBrowse.TPW

Change
INSERT(%MakeField, 'ViewPosition', '', 'STRING(1024)','Entry''s view position')
To
INSERT(%MakeField, 'ViewPosition', '', 'STRING(10000)','Entry''s view position')

###ABRELTRE.TPW
change occurs in two places
From
%[20]ValueConstruct STRING(1024) #<! Record POSITION in VIEW
To
%[20]ValueConstruct STRING(10000) #<! Record POSITION in VIEW

```

These are the changes I can find, put please post here if you find any more.

---

<div class="post-metadata">

**Author:** ![Clarion\_clarion](https://clarionhub.com/user_avatar/clarionhub.com/clarion_clarion/32/636_2.png) [@Clarion\_clarion](https://clarionhub.com/u/Clarion_clarion)\
**Post date:** [May 17, 2017, 7:17am UTC](https://clarionhub.com/t/what-causes-an-error-78-and-or-sometimes-phantom-records-in-a-browse/999/3 "2017-05-17T07:17:22Z")

</div>

Does **ANY** means Clarion type or just anything?

---

<div class="post-metadata">

**Author:** ![Rick\_UpperPark](https://clarionhub.com/user_avatar/clarionhub.com/rick_upperpark/32/346_2.png) [@Rick\_UpperPark](https://clarionhub.com/u/Rick_UpperPark)\
**Post date:** [May 17, 2017, 2:53pm UTC](https://clarionhub.com/t/what-causes-an-error-78-and-or-sometimes-phantom-records-in-a-browse/999/4 "2017-05-17T14:53:46Z")

</div>

I’m sure @Mark_Sarson means the ANY data type. It can have any length.

---

<div class="post-metadata">

**Author:** ![Clarion\_clarion](https://clarionhub.com/user_avatar/clarionhub.com/clarion_clarion/32/636_2.png) [@Clarion\_clarion](https://clarionhub.com/u/Clarion_clarion)\
**Post date:** [May 18, 2017, 6:13am UTC](https://clarionhub.com/t/what-causes-an-error-78-and-or-sometimes-phantom-records-in-a-browse/999/5 "2017-05-18T06:13:52Z")

</div>

Thank you for clarification 😌 👍

---

<div class="post-metadata">

**Author:** ![Mark\_Sarson](https://clarionhub.com/user_avatar/clarionhub.com/mark_sarson/32/6132_2.png) [@Mark\_Sarson](https://clarionhub.com/u/Mark_Sarson)\
**Post date:** [May 18, 2017, 10:37am UTC](https://clarionhub.com/t/what-causes-an-error-78-and-or-sometimes-phantom-records-in-a-browse/999/6 "2017-05-18T10:37:03Z")

</div>

That is correct Rick. Thanks for clarifying.

---

<div class="post-metadata">

**Author:** ![michelis](https://clarionhub.com/user_avatar/clarionhub.com/michelis/32/803_2.png) [@michelis](https://clarionhub.com/u/michelis)\
**Post date:** [November 23, 2018, 10:40am UTC](https://clarionhub.com/t/what-causes-an-error-78-and-or-sometimes-phantom-records-in-a-browse/999/7 "2018-11-23T10:40:57Z")

</div>

I have a Browse / Form that from time to time when the user Clicks on the from OK it gets error 78.  
Any way of inspect the ViewPosition Value?

---

<div class="post-metadata">

**Author:** ![brahn](https://clarionhub.com/user_avatar/clarionhub.com/brahn/32/756_2.png) [@brahn](https://clarionhub.com/u/brahn)\
**Post date:** [November 23, 2018, 11:00am UTC](https://clarionhub.com/t/what-causes-an-error-78-and-or-sometimes-phantom-records-in-a-browse/999/8 "2018-11-23T11:00:40Z")

</div>

You could edit the template and put in something to log the value, at least while diagnosing it. Unless you can repeat the problem on demand, then step through with the debugger I suppose.

---

<div class="post-metadata">

**Author:** ![elankreijer](https://clarionhub.com/user_avatar/clarionhub.com/elankreijer/32/1466_2.png) [@elankreijer](https://clarionhub.com/u/elankreijer)\
**Post date:** [July 18, 2019, 1:54pm UTC](https://clarionhub.com/t/what-causes-an-error-78-and-or-sometimes-phantom-records-in-a-browse/999/9 "2019-07-18T13:54:11Z")

</div>

In Clarion 10 in ABBrowse.TPW ViewPosition size is generated from a call to %ConstructQueue 4th parameter which is omitted and defaults to 1024.

Change  
#INSERT(%ConstructQueue,'Queue declaration for browse/combo box using '&%ListControl)  
To  
#INSERT(%ConstructQueue,'Queue declaration for browse/combo box using '&%ListControl,2048)

Changed all 1024’s to 2048 in ABBrowse.clw, ABFile.clw, ABWindow.inc. I’m not using VCR and RelTree.

---

<div class="post-metadata">

**Author:** ![Mark\_Sarson](https://clarionhub.com/user_avatar/clarionhub.com/mark_sarson/32/6132_2.png) [@Mark\_Sarson](https://clarionhub.com/u/Mark_Sarson)\
**Post date:** [June 16, 2020, 10:47am UTC](https://clarionhub.com/t/what-causes-an-error-78-and-or-sometimes-phantom-records-in-a-browse/999/10 "2020-06-16T10:47:17Z")

</div>

Just for the notes, I reported the issue to SV a while back and they have marked it as [bug confirmed](http://problemtracker.softvelocity.com/UpdtCustBugsview.php?ID1=42989):

---

<div class="post-metadata">

**Author:** ![elankreijer](https://clarionhub.com/user_avatar/clarionhub.com/elankreijer/32/1466_2.png) [@elankreijer](https://clarionhub.com/u/elankreijer)\
**Post date:** [June 16, 2020, 10:51am UTC](https://clarionhub.com/t/what-causes-an-error-78-and-or-sometimes-phantom-records-in-a-browse/999/11 "2020-06-16T10:51:42Z")

</div>

Sorry, seems that 2048 was not enough, i should have used 10000.

In ABBrowse.tpw there is also this function which is called without parameters for a filedrop control (and in ABCFree).  
Change:  
#GROUP(%ConstructQueue, %pDescription=‘’, %pAddMark = %True, %pPositionSize = 1024)  
To  
#GROUP(%ConstructQueue, %pDescription=‘’, %pAddMark = %True, %pPositionSize = 10000)

In ABFile.clw there is another position variable:  
SaveQueue QUEUE,TYPE,PRIVATE  
Pos STRING(10000)

---

<div class="post-metadata">

**Author:** ![Mark\_Sarson](https://clarionhub.com/user_avatar/clarionhub.com/mark_sarson/32/6132_2.png) [@Mark\_Sarson](https://clarionhub.com/u/Mark_Sarson)\
**Post date:** [June 16, 2020, 10:52am UTC](https://clarionhub.com/t/what-causes-an-error-78-and-or-sometimes-phantom-records-in-a-browse/999/12 "2020-06-16T10:52:16Z")

</div>

Please Note,

Originally after discussions in the clarion skype chats, I tried to use ANY for the position fields.

This caused a number of issues back when I did it, and so eventually I changed the ANY’s to STRING(10000). This is not perfect, but it’s what it is

---

<div class="post-metadata">

**Author:** ![elankreijer](https://clarionhub.com/user_avatar/clarionhub.com/elankreijer/32/1466_2.png) [@elankreijer](https://clarionhub.com/u/elankreijer)\
**Post date:** [August 18, 2020, 1:19pm UTC](https://clarionhub.com/t/what-causes-an-error-78-and-or-sometimes-phantom-records-in-a-browse/999/13 "2020-08-18T13:19:20Z")

</div>

After changing all ANY’s to a 10k STRING the error was still there.  
I found a post on TekTips that seems to solve ERROR78 for us now

[https://www.tek-tips.com/viewthread.cfm?qid=1463404](https://www.tek-tips.com/viewthread.cfm?qid=1463404)

> [@ShankarJ](#):
>
> The solution is to issue a BRWn.ResetFromFile() after BRWn.ResetFromView() parent call.

---

<div class="post-metadata">

**Author:** ![Koen](https://clarionhub.com/letter_avatar_proxy/v4/letter/k/a9a28c/32.png) [@Koen](https://clarionhub.com/u/Koen)\
**Post date:** [December 28, 2020, 3:46pm UTC](https://clarionhub.com/t/what-causes-an-error-78-and-or-sometimes-phantom-records-in-a-browse/999/14 "2020-12-28T15:46:32Z")

</div>

Hi All,

> [@](#):
>
> BRWn.ResetFromFile()

Thanks for this, it solved a problem I had with Easy Multi Tagging.

---

<div class="post-metadata">

**Author:** ![Alb](https://clarionhub.com/letter_avatar_proxy/v4/letter/a/f475e1/32.png) [@Alb](https://clarionhub.com/u/Alb)\
**Post date:** [January 11, 2021, 2:45pm UTC](https://clarionhub.com/t/what-causes-an-error-78-and-or-sometimes-phantom-records-in-a-browse/999/15 "2021-01-11T14:45:50Z")

</div>

Hi everybody,

I use to fix this error by declaring the following variable in the offending Browse procedure:

**ViewPosition STRING(2048)**

and then adding a hot field to the browse extension:

 ![immagine](https://clarionhub-uploads.s3.eu-north-1.amazonaws.com/original/2X/4/4f80f7494c637a29b5eb19f0dd3b05bb74595627.png) .

When the procedure is compiled a warning is reported but it’s ok because the browse QUEUE has two ViewPosition fields and we want that the first one (the one we just added) is used:

![immagine](https://clarionhub-uploads.s3.eu-north-1.amazonaws.com/original/2X/0/0c3de6d3bad3aafb1a3273d995dea20286d07b3e.png)

 ![immagine](https://clarionhub-uploads.s3.eu-north-1.amazonaws.com/original/2X/f/fddbe28c0382d9a314ac9ab1721933c3806aa2ae.png)

Hope this helps,  
–Alberto

---

<div class="post-metadata">

**Author:** ![SDigitales](https://clarionhub.com/user_avatar/clarionhub.com/sdigitales/32/4338_2.png) [@SDigitales](https://clarionhub.com/u/SDigitales)\
**Post date:** [January 14, 2021, 8:08pm UTC](https://clarionhub.com/t/what-causes-an-error-78-and-or-sometimes-phantom-records-in-a-browse/999/16 "2021-01-14T20:08:48Z")

</div>

mmmm  
Not work for me…  
But in a Browse where error 78 occurred frequently, remove the Tooltips … and the error did not occur again.

---

<div class="post-metadata">

**Author:** ![Grant\_Cameron-Smith](https://clarionhub.com/user_avatar/clarionhub.com/grant_cameron-smith/32/1526_2.png) [@Grant\_Cameron-Smith](https://clarionhub.com/u/Grant_Cameron-Smith)\
**Post date:** [February 14, 2021, 8:55pm UTC](https://clarionhub.com/t/what-causes-an-error-78-and-or-sometimes-phantom-records-in-a-browse/999/17 "2021-02-14T20:55:50Z")

</div>

I managed to fix this error consistently for me - I have had this problem in 6 different areas of my app.

I declared aliases for the offending tables and then used them and my problemswent away.

---

<div class="post-metadata">

**Author:** ![anon23294430](https://clarionhub.com/user_avatar/clarionhub.com/anon23294430/32/3829_2.png) [@anon23294430](https://clarionhub.com/u/anon23294430)\
**Post date:** [November 5, 2022, 10:42pm UTC](https://clarionhub.com/t/what-causes-an-error-78-and-or-sometimes-phantom-records-in-a-browse/999/18 "2022-11-05T22:42:24Z")

</div>

The post here [WindowManager.Update calling BrowseClass.UpdateViewRecord - RC = ErrorCode() - Error 78 Invalid Number of Parameters - #4 by anon23294430](https://clarionhub.com/t/windowmanager-update-calling-browseclass-updateviewrecord-rc-errorcode-error-78-invalid-number-of-parameters/5600/4) contains a fix which should sort out the error 78 issue. Position() is sometimes too big for the Queue ViewPosition which is 1024 chars.

---

<div class="post-metadata">

**Author:** ![Mark\_Sarson](https://clarionhub.com/user_avatar/clarionhub.com/mark_sarson/32/6132_2.png) [@Mark\_Sarson](https://clarionhub.com/u/Mark_Sarson)\
**Post date:** [November 6, 2022, 10:24am UTC](https://clarionhub.com/t/what-causes-an-error-78-and-or-sometimes-phantom-records-in-a-browse/999/19 "2022-11-06T10:24:22Z")

</div>

Thanks Richard,

That was one I had found but I note I had not documented it above.

I also found issues in 3rd party templates, I would have to go back and check which ones, but I remember Mike @BoxSoft uses 1024 in a product of his. Again, I’ll have to dig through my changes.

By all accounts, I don’t think SV are keen to change the size, I use 10000, but I do understand that might be overkill for some.

Mark

---

<div class="post-metadata">

**Author:** ![anon23294430](https://clarionhub.com/user_avatar/clarionhub.com/anon23294430/32/3829_2.png) [@anon23294430](https://clarionhub.com/u/anon23294430)\
**Post date:** [November 6, 2022, 10:44am UTC](https://clarionhub.com/t/what-causes-an-error-78-and-or-sometimes-phantom-records-in-a-browse/999/20 "2022-11-06T10:44:21Z")

</div>

The problem is the TPS file specs allow keys upto 15,000 bytes in size, so the ABC templates needed to be made to work with the TPS file specifications as a minimum.

Once I’d established the clarion debugger was giving me duff info which was messing me around, that template hack seemed like the best workaround. Any other problems in the classes should get highlighted very quickly and I note there are other places in the ABC classes where local variables could be too small or the wrong type, I havent looked at your ANY data type changes yet in any great detail.

But this template hack to make Q ViewPosition the same size as the key length + 4 bytes output is a minimum to get the ABC classes to work with Position().

I had Mikes tagging templates along time ago, I cant say I remember it using Q ViewPosition, I know it had its own files which had to be added to the dict to store the any tagged browses, but I never saw any code where it used Q ViewPosition, but maybe I wasnt looking hard enough.

One other thing I did learn, is that it wasnt a Brit who wrote the StandardBehavior ABC class because the U isnt used, unlike here in the UK where U is used in the word Behaviour which draws its roots from France and the land owning Normans…

Like you have documented, there are restrictions in the class methods with local variables so I might need to still apply those changes you have documented but I havent come up with any tests which make it fail, unless you’ve got some tests which will make a class method fail?

I’ve been modifying the ABC classes in places to make it less obfuscated as well, it then gets easier to see WT\_ is going on. 😀

[Next page](https://clarionhub.com/t/what-causes-an-error-78-and-or-sometimes-phantom-records-in-a-browse/999.md?page=2)
