MS Access 2007 error number: 2950 on Trusted Document? - macros

In my *.mdb file I have a macro with an action that runs TransferText and gives me an Error Number of 2950 which according to Microsoft means that the document is not trusted, as far as I know it is trusted! It's located in the Trust Center Trusted Locations.
Is there an explanation point next to the Action causing this in the macro whose tooltip reads This action will not be allowed if the database is not Trusted.
I already tried running a compact and repair on it, what could be causing this?

Method 1: Enable the database for the current session
When you use this method, Access 2007 enables the database until you close the database. To enable the database for the current session, follow these steps:
On the Message Bar, click Options.
In the Microsoft Office Security Options dialog box, click Enable this content, and then click OK.
Note You must repeat these steps every time that you open the database.
Check here: https://support.microsoft.com/en-us/kb/931407

The problem can be as simple as not having first established an ODBC connection. I was getting this macro error (2950), and I ended up reading all the support threads, getting nowhere.
Then it struck me to install our ERP client first --which is the front-end for the database I was trying to access ...with Access.
Doing this established an ODBC configuration, so now when I opened my Access file, an ODBC prompt opened up before I even got to any of the functions that were triggering the error. In hindsight, I could have passed on installing the ERP client, and just went to the ODBC settings in Windows, and pointed a connection to the SQL table.

In my case there was a naming conflict. The macro in turn called a VBA function, and I had inadvertently named the function with the same name as the module it was in. They were both named "RobertsReport". Once I changed the name, everything worked as expected.
Tip: As troubleshooting steps, try running the macro solo by double-clicking on it. If you can, copy only the line that generates the error to a new macro to test it by itself, and of course include any preceding commands it may need to run properly. Once I did this it greatly narrowed down the problem until the lightbulb came on over my head.

Related

How to periodically 'touch' temporary files on remote server so the files don't get deleted

I log on to the remote server using SAS/Emacs. On the server, there is this space where I can save files for about a week. Unless I refresh or 'touch' those files again, they will get deleted after a week. Is there a macro or a code that I can execute whenever I open SAS/EMACS so that these files stay updated?
So far, I have used SSH to go on to the server and type 'touch /*' to keep it 'touched', but I am hoping there is a better/more efficient way to keep those files touched.
Assuming you're using EMacs Speaks Statistics to connect to SAS, then you have a couple of different options.
One is to modify ess-sas-submit-command to point to a script that first does your "touch" command and then starts SAS.
Another is to create an autoexec for SAS to do that for you, assuming you have rights to do so; you can add that to various locations in Unix or to the command line itself (depending on how you're launching SAS).
Even if you're not using ESS, the Autoexec method may work for you.
Note that, of course, your system administrator may not appreciate doing this, so do make sure this is permissible (unless that sysadmin is you!).

LibreOffice macro user instruction

I have a LibreOffice Calc document which needs to be downloaded by remote users. It uses macros - so they need to have macros enabled for it to work at all and there is no control over user machines.
To help with this I have a text message on the first tab telling them they need to enable macros and some instructions how. On document open I run a macro to remove this message - as long as they have macros enabled they never see it and all is well.
This solution works but is not perfect because:
It will trigger the save changes dialogue even if they did no changes.
It leaves the message removed if they save and pass the document directly to another user.
Just doesn't feel like a well-engineered solution
Is there a better way to accomplish showing this message only when macros are not enabled?

Access Table Update fails on some computers

Okay, this is kind of odd and it is driving us nuts. I'll outline what is going on as best I can, then I can provide specific details and/or code as folks request it, because I'm not sure what will be needed to suss this out.
I have an access database I have built so our analysts can work within a queue, select records, do whatever research is needed, then either mark the record in question as okay, or fill in some blanks and mark it as needing a dispute (we work in billing).
Basically, the database opens and a hidden form pulls the NT User Name from the local machine, then opens a visible form that queries the database via SQL ODBC to display a list of records with that NT User Name attached to them.
The user can then scroll through the records, select them to get more information, and click a button to mark them as okay, or another to mark them as needing a dispute.
If they click the okay button, it fires off an update query to mark the record as okay. If they click the dispute button, then it opens a third form to show them the line item they are disputing with values from all of the other text fields on the form that they can select from/fill in. On that form there is a button to commit the dispute, which fires off another query to update the values into the same table as the 'okay' button.
So, the issue is, that this all works perfectly on my workhorse machine, and an essentially naked test machine. It also works on another co-worker's machine. However, whenever we try to run it on two other coworkers' machines, everything works just fine, except for any of the queries that attempt to write back to the ODBC connection. All of the read-only stuff works just fine, just not the updates. But the updates work perfectly, and super-fast on my machine, my test rig, and my other co-worker's machine.
We've tried reinstalling the ODBC connection, and the ODBC SQL Drivers.
No go.
We've tried just opening the table in question on the affected machines and making direct edits to the table.
This works if no forms are open in the database, but as soon as we open a form, no update query will run against the table.
So, we tried commenting out all code on all open forms except the docmd.openquery code for the single button we used to test the update query.
No go.
We even built a new form with just a button on it that triggers a new update query that makes only one simple update (Now()) to the table in question.
This runs fine on its own, but times out when run off the button click from the form.
We tried changing the MS Office install on one machine to 'run all from computer' to make sure all necessary components are installed/present.
No go.
We tried installing the ODBC connection both via the normal windows interface, and through the access linked table manager interface.
No go.
We tried installing both 64-bit and 32-bit ODBC connections, both under USER DSN and SYSTEM DSN, and all permutations of one and not the other that we could think of.
No go.
It seems that no update query will write to that table while any form is open, but works just fine with no forms open. But only on these other two machines. Everything works fine on the other three machines we've tested on, whether forms are open or not.
We're kind of at wit's end here and don't know where to go. Google is proving unhelpful, possibly because we just don't know exactly how to search the problem out.
Here's basic technical stuff and I am happy to provide whatever other details, code, queries, etc. that are needed to troubleshoot upon request:
OS: Windows 7 Enterprise 64-bit
Software: MS Office Enterprise 2013 32-bit
ODBC: SQL Server
All users have admin access to their respective machines.
Turns out that the issue here seems to have been an intermittent issue with Access being unable to determine which record to update due to the way we were calling details from a continuous form.
We went back to formula on our UI and built it so there is only ever one record on a form when we try to make changes to records, so there can be no system confusion about what record to update.
Still no clue as to why it was working intermittently, but the new iteration is working now.
Thank you all for your questions and suggestions. :)

Start an application at system start without login

We have a new server running and we got some new programs doing import routines. So far so good... But there is one program that is put into autostart folder. So it doesn't run until admin logs in and it stops if we logout.
I'd like to put this one into a seperate session so it may work without any interaction by simply starting it with the task scheduler at startup. Is this the right way to do this? Is it safe if I log in later and log out?
Many thanks!
Edit: The applications shows as a symbol in the task bar if running, it can be configured by this. Anything I must know about this if I change?
Edit: It is not my application, I cannot rewrite it as a service.
I successfully added the application by using task schelduler on startup. Login and logout will not quit the application but no symbol is shown. Please add details to my side questions and I'll mark your answer as the accepted one.
Edit: Ended up using this one. If I have to configure, I stop the application in task manager and start it again by link. After that I quit the application and restart it by task scheduler manual start.
You need to run your program as a Windows Service. One way of doing it is using the sc.exe program:
> sc create <new_service_name> binPath= "c:\myapp\myapp.exe"
You can read about it here.
You need to separate your application in two.
To allow it to run without a user session, you need a windows service. That should handle all the background stuff. You can then register the service and set it to start when the system starts.
To allow it to have a UI, and show up in the notification area, you need a windows application. This will be in autostart as usual, and will communicate with the service - for example, over named pipes.
While it is still (barely) possible to run an UI application without a user session, it's only maintained for backwards compatibility, and already shows a lot of problems. It will likely be removed altogether in the future, because it breaks quite a few contracts. Do not rely on hacks like this.
I also used the task scheduler to create the application at system startup. It should be noted that if you want to use for mining, you have to disable an option in "settings" where it says that if the application lasts more than three days in a row it will end.
It really works wonderfully!
it is a old question but I recently solved in another way...
(before I was using a scheduled-task for startup but this gave me diverse problems with lots software...)
Some programs also for diverse reasons must be run at a user level... or even inside a specific user session...
So the best way I found was to use a tool like Sysinternal/Autoruns to program the auto-logon to a specific user (it is a registry setting)... and in the startup-folder of that user (or any other "autorun/autolaunch" task)... run a script that first locks the screen... and next runs the other intended programs... that will run under that user profile...
so you can choose a standard user or a administrator... or even launch programs from a standard user in adminsitrator mode...
I hope will help...
This "hack" solved me many problems with startup apps...
I could not get the "sc create" command to work. Instead I manually edited the registry using regedit. I added a new key in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services.
I used the following page to figure out required parameters and their values. Note that the names do not map.
https://learn.microsoft.com/en-us/windows-hardware/drivers/install/inf-addservice-directive
Old question, but for anyone that stumbles here. Use srvany to set the program as a custom service.
Note that when you do this with for example dropbox, googledrive, etc., you will need stop the service, then open the program normally to make changes like password, updates, etc.
below is a well enough intro.
https://www.iceflatline.com/2015/12/run-a-windows-application-as-a-service-with-srvany/
Download the tool kit here
https://www.microsoft.com/en-us/download/details.aspx?id=17657
Convert user application to Service and Register it using Regsvr32 or installutil.exe. It will start the service using SYSTEM user account. Which is a high privilege account.
Note : You can`t run any Window based application. Even a Message only window.

Configuring VB6 with VSS 2005

I have configured VB6 with VSS 2005, following functionality working fine :
Check In and Check Out of code
Get Latest Version
Showing error when code Check Out by another user.
Showing error if use try to edit code without Check In ( only when user takes latest version)
Difference I am finding in VB.Net and VB6 configuration with VSS are :
Code not getting Check In automatically when user try to edit code, without Check In Code.
Not allowing user to save changes and Check In code later after 1 or 2 days. User require Check In code before closing code.
Showing "Path/File access error:" for .vbp file.When user tries to save code on machine.
Allowing user to edit code without Check in when user opens the code first time.
I did all the settings mentioned in this link.
As MarkJ mentioned the vbp file is always saved when the application runs. You can cancel out of the dialog to run the project anyway but this is more hassle than just right clicking on the project root and checking out.
I am using Team Foundation Server with my VB6 projects and there is no auto check out in this either. I'm afraid you will have to live with it until you port the code the .NET
As I mentioned heredead link: WayBack version there is also a problem when you have some files or documents not in SourceSafe.
Specifically (as I still document here), when some of the files of a project are not associated with SourceSafe often no files have their SourceSafe status glyphs displayed.
The workaround I found was displaying the Add Files dialogue and then cancelling it. I offer my public domain add-in that automatically implements this workaround.
And BTW, make sure you install the latest VSS Service Pack.