After acDialog form made not visible ms Access eventually throws error when exiting - ms-access

I've got a search results form in my Access client which uses the trick of being a form opened in acDialog mode. If the user cancels the search the form closes itself, if the user selects one of the search items, the form writes the result into an unbound field and then makes itself not visible.
The calling code will suspend (because of the acDialog mode) until either of the two events described in the previous paragraph happen. The calling code checks to see if the form is still loaded - when it knows a search item has been requested, so it retrieves the item from the form and then closes it. If the form was already not loaded, we assume the cancel route was chosen.
the search results datasource is a select statement "SELECT * FROM details ORDER BY ..."
This trick has worked for a while in the code where "details" is a linked table to another Access database
I am porting to SQL Server, and the details table is now dynamically linked at startup to the correct SQL Server instance. Using the following connection string
ODBC;driver=SQL Server;SERVER=ROO\SQLEXPRESS;DATABASE=Test_DB;UID=my_app;PWD=xxxx;
(Passwords etc changed to protect the innocent)
When Access exits the application (AND ONLY THEN) - if the path through the code has resulted in using the visible = false trick then it exits with an error message. There is no error message if there is an application exit where the path has been through the search form but the form closed itself before returning.
The error message is:
Cannot access database because of Error [Microsoft][ODBC Driver Manager] Data source
name not found and no default driver specified
and will now Exit.
I need to find out precisely why this is happening and stop it.

I solved the problem with a work around. I created a global variable for the form result and then always closed the search result form itself. The underlying routine that was trying to pick up the result just uses the global variable.
This proved that making a Dialog box invisible to retrieve results is not reliable - the problem disappeared as soon as I changed it.

Related

MS Access not working for multi user

I have a DB I created as a sort of real time virtual client check in log. It would be stored on an intranet network drive. In theory, a greeter can send client information back to be picked up by another worker. This is done through a series of forms, tables, and queries. When I test it myself on my own machine, opening both the greeter and reception forms I can enter information on the greeter, click the action button to send it to the table, where a timered query(held in a hidden form opened with an AutoExec macro) picks up the current record, and then displays it on the reception form. Everything works perfectly. The only problem is, when I try to test it on multiple computers, the greeter can send info back, it appears on the table, but the reception form never populates. Any ideas where the disconnect might be?
edit I have decided I want to do away with the hidden initialize form, so I've re-organized the code as follows. It still works when I do it myself on one computer, but opening the reception form on another computer it still fails to populate.
Reception 1
Private Sub Form_Timer()
If gClientID > gNextClientID Then
gblnRNC = True
Else: gblnRNC = False
End If
If gblnRNC = True And gblnRec1Free = True Then
gRec1CL = gNextClientID
MsgBox "There is a new client to be seen.", vbSystemModal, "New Client Warning"
Me.RecordSource = "RecClientIDNum"
End If
End Sub
So forgive my noob question, I sorta jumped into programming procedures without fully understanding how Access works. I declared global variables but didn't realize they were only global within the scope of the local session running on a particular machine.
Moved the variables that establish the interactions between the various forms to a table and everything works perfectly.

How to have continuous connection with MYSQL?

I have an application in JSP, using MYSQL database and Apache 6.0 server.
Interfaces : Admin and Client
Requirement : Admin should get all the client names who are logged in. There is one text-box, if admin enters any message in text-box and clicks on any client, that message should display on the client browser.
Current Implementation : Once admin clicks on the client name in database I am updating a column named 'status' with the text box value. (Initial value of 'status' column keeping as FALSE).
On client side I have set interval method which is calling a servlet using ajax (every second) and executing a query which checks the 'status' value, if it's NOT FALSE I have a function which shows the retrieved value on the page.
Issue : Due to the one connection per client per second, MYSQL is taking 100% CPU usage and crashing down. I have around 200 clients using the application simultaneously.
I need an alternative and efficient solution for this.
Any help will be really appreciated.

Reporting Server error: cache refresh plans cannot be created or edited because the associated item has user profile dependencies

I published my first report on Reporting server and I've tried to set a cache plan and I have the error
cache refresh plans cannot be created or edited because the associated
item has user profile dependencies
Any suggestions?
After hours of search I've found the problem was that the report contents the had a reference a the user profile property (as said the message) User!Language in a DataSet. For resolve I added a custom code that return the value runtime and replace the property with expression
"=Code.GetLanguage()".
Funtion GetLanguage() as String
return System.Threading.Thread.CurrentThread.CurrentCulture.Name
End Function
Of course the problem occurs for any the user profile property (User!XXX)

If there is a way to restore user input after failed server side validation using angularjs?

I have a page using angularjs, everything looks good except one thing: after user clicked submit button and the server side validation failed, the user input will be gone, but when I checked the html tags, the value="xxx" attribute saved the lost value, how can I get and render it to my page?
Thanks a lot!
Not sure about your exact scenario, but what you can do is to make the copy of original model object and bind it to form
$scope.editItem = angular.copy(originalItem);
Bind editItem to the form.
If the server validation fails just call the above statement again and the editItem would be restored to original value.

Windows 7 SP1 breaks access (not the ADO way)

So our corporate IT dept has determined that it is time to force SP1 on everyone's PC's.
Which means I need to get my Access 2003 ADE application working with the stupid ADO incompatibility problem.
I got the ADO portion to work by following KB2517589, but now several of my textboxes say #Name?.
These are bound to code, so, for example, the data field in the textbox is =CalcShippingAddr().
As a test, I replaced the code with the following:
Public Function CalcShippingAddr() As String
msgbox "Func Called"
CalcShippingAddr = "Test"
End Function
This works fine on my dev machine, but as soon as I make an ADE and send it to a PC without SP1, I get #Name? on the textbox. The msgbox nevers pops up.
Any ideas what might be happening?
This is a fault to do with the field calculation, I haven't seen it myself but have heard that clicking in to the relevant text box would then show the value although this is not a solution. I would always recommend using unbound forms as you can control step by step what your fields/objects are doing. As you already have a custom function to calculate the shipping address then it should be simple enough for you to add the code the the forms 'Open' or 'Load' event e.g.
Private Sub Form_Load()
textbox = CalcShippingAddr
End Sub