Communicating with the OLE Server or ActiveX Control

僤鯓⒐⒋嵵緔 提交于 2019-12-22 03:16:57

问题


MS Access 2010, Win 7 on a regular form
I didn't intentionally place any ActiveX or OLE things.. not even sure what they are. But anyways, whenever I put something in the code of a particular form, it says
"The Expression XXXXX you entered as the event property setting produced the following error: A problem occured while MyDB was communicating with the OLE server or Active X Control

Huh? No matter what I put in the form's code, this happens. I had an empty Form_Current() ONLY which still tripped this. There's a lot of formatting and work into the form, I'd rather not scrap it.. If I leave the code window completely empty (only Option Compare Database), it does not trip the error; however then my form is useless.

I've seen things about this being a language issue, but my other forms (running the same code techniques and most of the same code) are fine and it's an english Access with an english language PC. Ideas?

Code setting off the error:

Private Sub Form_Current()
End Sub

Seriously.


回答1:


Check for missing references. Make a back-up, decompile, compact & repair and if that does not work, copy everything to a new db ( http://www.granite.ab.ca/access/corruptmdbs.htm ) You may have to skip copying the problem form. Sometimes it is worth creating a new form, selecting all the controls from the old form and pasting into the new form.




回答2:


I faced the same problem and I tried many things, the only (and fastest) solution that worked is to do the following: 1) Close the form that is causing the error. 2) Rename this form. 3) Duplicate it: Copy, then Paste, you will be prompted to set a name for the new form. Give it the original name. 4) Delete the original form that was causing the error. 5) Open the pasted form and it will work OK. This solution worked fine with my database... Regards...




回答3:


you can change the language setting to have a try, the steps are as follow: 1、Open window command ,run "intl.cpl" 2、choose the Administrative item ,change the system locale settings.

Hope that can help you.




回答4:


I have run into this problem many times. The error statement is horrible as it provides basically no useful information. I have found that Abu Hassan's solution typically works best (duplicate the form and delete the original) but that did not work for me on one occasion, where I had to delete an import statement that I had recently added:

imports system.collections

Once I deleted that import statement everything worked again. So if duplicating the form doesn't work then try undoing something you recently did. It could be this import statement or one similar to it.




回答5:


Very strange error, that sometimes occurs in my databases too. It seems to go wrong mostly on UNBOUND FORMS (unbound forms have no RECORDSOURCE). What I have done recently is :

  1. temporarily define "some" table (e.g. a config table with just one record) as the RecordSource,
  2. compile the program (Note that this usually goes OK, even before the fix!)
  3. Save the form.
  4. Open the form. This should work fine now!
  5. Delete the RecordSource, recompile and save again.
  6. Most of the time, my forms work fine again after that.


来源:https://stackoverflow.com/questions/10637622/communicating-with-the-ole-server-or-activex-control

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!