Access Front MySql Back Runtime Error 7878 - runtime-error

RunTime Error The Data has been changed.
I`m having a difficult time with one of my sub-forms. It used to work without complaints but I guess now it decided to be a little verbose. On this form I have a subform that has a variety of checkbox options. Whenever the user enters a checkbox option and then exits to the main form there is an On Exit Event which runs. It combines some textboxes from various forms and then puts that value in a textbox on the main form.
var1 = [Form1]![Textbox].Value
var2 = [Form2]![Textbox].Value
var3 = [Form3]![Textbox].Value
Me.[TextBox].Value = var1 & var2 & var3
For some reason upon exiting the subform I am getting the Runtime error.
The pattern is not apparent.
I can navigate from the subform to the main form without making any changes in either without receiving an error message.
If I go into the subform, make a change, exit the subform, the textbox will be updated with no complaint, however if I go back into the subform, do not make a change and then go back to the main form, then I get the runtime error
similarly after making sure that behavior 1 is true I can go into the subform, change something come back out, but if I try to go back into the subform and make an additional change I will get a complaint. (I was able to fix this by making an on enter event refresh the subform)
I am unable to get the Runtime Error fixed though... :(

I see that this is an issue for many people with no solution. Here was my work around.
From my observation the form that was having it's Textbox.value updated is somehow silently updated by either the on enter or on exit of it's subform so when the on exit action of updating that textbox occurs it complains that the main form was updated, thus leaving me to conclude that when that form is updated it is not shown to the user.
Thus, my work around is to requery the main form on the subform's exit in order to get that new data loaded and changed.
Caveat!! Requery will by default bring you back to the first record thus presenting the possibility of changing the textbox of the wrong record. Thus as part of the requerying process, if you choose this hack, you will have to bookmark the current open record, requery, and then fetch that record again. I used the code from this webpage in order to achieve the desired effect. Thus circumnavigating the 7878.
Requery and stay on record:
http://www.baldyweb.com/Requery.htm

Related

Qt 6 crash in QPlainText::setExtraSelections after QPlainText::setDocument

I'm trying to set up a text widget that highlights the searched word, when I open a new file with QPlainText::setDocument, then immediately use QPlainText::setExtraSelections I get a SIGSEV crash in:
QTextDocumentPrivate::rootFrame
QTextDocumentPrivate::frameAt
QTextCursorPrivate::complexSelectionTable
QTextCursor::hasComplexSelection
QWidgetTextControl::selectionRect
QWidgetTextControl::setExtraSelections
QTextDocumentPrivate is causing a SIGSEV because it is a null this pointer. But this doesn't happen if no word is set before the document is loaded.
I must be supposed to do something to force it to generate the QTextDocumentPrivate. But I have no idea what that is.
Actually, this happens because QPlainText::setDocument does not remove the prior results of QPlainText::setExtraSelections. So when setting the new selections tries to remove the previous things selected, they all have invalid pointers and that causes the crash.
To fix it call: textEdit->setExtraSelections({}); to clear out the selections prior to calling QPlainText::setDocument.

Access 2013 unable to add new line to form and runtime error 2105 when trying to a new record

I am migrating several adp files to accdb so that it can work under access 2013 but one problem is driving me nuts:
I have a form on which I cannot see an empty line to add new data.
the form property allowaddition is on
the recordsource of the form is an sql View to which I can add a new line directly from access (so it is not readonly)
I am forcing the AllowAddition on the code when initializing security with me.allowadditions = true (this used to be enough to make it work in the old adp)
I have a button to add a new line to the form that runs on_click and gives me a runtime error on this line of code Docmd.gotorecord , , AcNewRec
The runtime error is "2105 : you can't go to the specified record".
This tells me that there is something that is still read only.
the SQL View has an index as well as all the table used in it.
I tried to replace the view in the recordset of the form by a table and still not working.
Am I missing something? What else can I do to be able to add a new record to my form (or view)?
Thank you
Try setting focus to one of the textbox controls in your form before calling the new record, something along the lines of
me.txtControl.SetFocus
The reason is, SQL Server backend allocates new records differently than Access backend, and Access does a bit of magic for you in the interface, so I've found sometimes explicitly setting focus to a text control will fix this issue.
Depending on how things are structured with your Access app, if that suggestion doesn't work, then you might need to go the extra step of programatically creating the new record (blank fields except for primary key) in SQL Server first and then refresh the Access form and then setfocus to the newly created record (e.g. either the last or first record depending on your recordsource sort order)

ASP.Net: How do I find this error?

I'm getting the following error when I try to run an ASP.Net page. It just popped up during development, and I don't know what the cause is.
"OverflowException Occurred. Value was either too large or too small for an Int32."
The line the debugger breaks on is of absolutely no help at all
Dim ApproxDate As TextBox = FormView1.FindControl("CurrentResultDateTextBox")
The error is occurring on this line because calling findControl on FormView1 causes it to databind (executes a SQL query to return the dataset). I assume the error lies somewhere in one of the object data sources or possibly one of the grid views on the page, but the debugger won't tell me where. Most of the page data sources are bound declaratively (specified in ASP tags in the source)
Pressing F11 to run past the exception displays the following:
"13712696100373320501120906 is not a valid value for Int32."
The value being shown here is the primary key for the main SQL table used by the page. There are about 10 data sources which use this field. Again, there's no indication of where exactly the error is occurring.
So how can I debug an error like this? Are there commands I can run? IIS error logs? 3rd party software to capture the error? I'll take anything I can get
Managed to find the problem. The trick is to first disable "just my code" in the IDE/Debug settings. Then you can see the system functions on the call stack, and while there is no source code, you can click on these functions to unwind the stack to one of the web controls (in this case the ListControl.PerformSelect function)
If you check the auto variables in the debug window, it will show the control involved in the error. From there I added a watch on the ID property to see which control it was, looked up the data source that feeds it, and found the error.
You can also unwind the stack to the ObjectDataSourceView, look at the dataTable property, and call GetErrors() to see the issues. This returns an array of data rows which are flagging errors; The property RowError will show the error message for any given row.

how to use QTable::editCell()

I don't understand how QTable::editCell() should be used. I am trying to do some error checking based on entries made by user in a QTable as mentioned in my another question.
I would like to give user an opportunity to re-edit the cell which has error. For example, if name column entry has some special characters such as '(', the user should be prompted for the error and the control should go back to same cell in edit mode. I tried using QTable::editCell() in my code as shown below.
Table->editCell(row, 0, TRUE);
name = Table->text(row, 0);
However, this doesn't work as expected. The control doesn't stay in the cell at all and obviously the name is not correctly collected. So, my question is how to ensure from within code that a cell of QTable can be edited so that the edited contents can be accessed immediately in next statement (as shown in above code).
Note: I am working with qt 3.3.8 only.
I don't think you can do that. You'll have to go back to the event loop, and wait for one of the signals (like valueChanged(row,col)) to be fired to re-validate the data.
A blocking wait on a GUI object is often not a good approach (except for modal dialogs).
I know I'm a little late here but you should use the following connect statement with your own custom function to do your specific needs such as below. You can also use this method to disable users from entering in special characters within you custom function. That way they wont ever have to correct undesirable characters.
connect(ui->tableWidget, SIGNAL(cellChanged(int,int)), this, SLOT(customFunction(int,int)));
void updateTable
{
//remove invalid characters
}

SqlSiteMapProvider - OnSiteMapChanged event never fires?

I'm doing the Wicked Code implementation of SqlSiteMapProvider, except in VB.NET.
There's a few things with the code that are causing issues, and I don't understand how it is supposed to work the way it's written in the article. I've provided the code straight from the article provided below. I've pasted the code here for ease of viewing
First issue - the depedency is instantiated BEFORE (lines 134-137) the tree is created (151-160) - so as soon as you add the depedency to the http.cache (165-167), the OnSiteMapChanged event (242) fires immmediately - making the entire proccess run again - and this loops many times until finally something makes it stop. (i stepped through it and counted the code looping at least 20 times before I gave up on trying to guess when it hit last)
OK, so to fix this I just moved the code to the create the dependency to AFTER the tree is built, right before inserting to http.cache (so HasChanged property is false when adding to http.cache, and you don't get stuck in this psuedo-ifinite-loop).
I still have a problem though - every time a page loads, the BuildSiteMap() hits and line 121 checks if _root is not null - it seems it is never null after it is first built... this is good because I don't want to hit the DB each time. Now, I insert a record into the table... the OnSiteMapChanged event never fires. As I browse pages on the app, the sitemap does not reflect the newly inserted record - stepping through the code, I see that the check at line 121 is still causing the function to short circuit... The sitemap will only refresh if i re-start Visual Studio, which causes the private _root field to become null again, and re-builds the sitemap, reflecting the new changes.. (refreshing the browser or starting new browser instances does not work)...
EDIT: THE ISSUE STEMMED FROM A SILLY 'SET NOCOUNT ON' LINE IN THE TOP OF MY STORED PROC. APPARENTLY THIS BREAKS THE QUERY NOTIFICATION. It seems that this statement is seen as a result set and that the second, actual query statement invalidates the result set resulting in a notification. This was very hard to find and nowhere in the MSDN documentation until I added the comment. Hope this saves someone else the miser I went through!
THE ISSUE STEMMED FROM A SILLY 'SET NOCOUNT ON' LINE IN THE TOP OF MY STORED PROC. APPARENTLY THIS BREAKS THE QUERY NOTIFICATION. It seems that this statement is seen as a result set and that the second, actual query statement invalidates the result set resulting in a notification. This was very hard to find and nowhere in the MSDN documentation until I added the comment. Hope this saves someone else the miser I went through!

Resources