0

Working in XE5 Delphi. For a given ClientDataSet this filter is working: Strap LIKE '18%'

but this one do not: Strap LIKE '1%' . Meantime Strap LIKE '%8' works fine, but Strap LIKE '%18' do not. The Strap field has a string type, always with 17 characters (never empty).

Every time the error is a (windows) "c0000005 access violation", but this is non-sense since, however, Strap LIKE '%18%' or Strap LIKE '%1%' or Strap LIKE '%8%' ALL works fine. Definetely the data exist, and the program HAS access to them. When the error appears the stack holds on the midas.dll, but this is registered and works fine with other filter patterns.

Same behaviour for ALL fields in the dataset. Filter patterns as 'x%' or '%xx' do not work (where x is ONE character), all others work.

What is happening?

Laszlo
  • 51
  • 7
  • FWIW, this sounds like a bug (not yours) to me. – 500 - Internal Server Error Jan 02 '14 at 19:21
  • do you have all hotfixes installed ? did you try replacing registered midas.dll with one of XE4 ? – Arioch 'The Jan 02 '14 at 19:37
  • In this case must appear for many users. ClentDataSets are very often used. Did somebody notice such a behaviour? By the other way, when I started my program the filters worked well. Adding new features, don't know exactly when and why, noticed the error. Since then could not solve it. – Laszlo Jan 02 '14 at 19:40
  • @Arioch'The As I said, the filters worked well till a moment. It is NOT a matter of hotfixes or midas. – Laszlo Jan 02 '14 at 19:45
  • How about when not debugging? – Sertac Akyuz Jan 02 '14 at 19:51
  • @SertacAkyuz Sane error! – Laszlo Jan 02 '14 at 19:54
  • 1
    Midas is very fragile thing, and stack trace goes into it. So it *IS* the issue of midas. The question is to understand what triggers this bug and how to workaround it. Or to find Midas version that does not have this bug and doe not have other bugs critical for your app. I's starting with trying to pick another midas version that works. Especially if you gonna deploy the program to different clients, then using global registered midas.dll is a road to DLL Hell. One thing to try is using MidasLib instead of Midas.DLL, other - trying different versions of it – Arioch 'The Jan 02 '14 at 20:30
  • There is also a custom hi-performance midas implementation, but it is not public alas. // then some data you generated while developing the program could cause that. Some specific data that just did not existed before. // and if you're are adamantly sure that is something in the program itself - run older version of the program and ensure the bug is gone. Usually just running `git bisect` or something like that allows you to locate the code line, triggering the bug, in few hours. – Arioch 'The Jan 02 '14 at 20:32
  • @Arioch'The Thanks. The SAME MIDAS worked a couple days ago with the SAME program and data. Followed the debugger (in midas) till FExpParser procedure, which it seems is not accepting the filter pattern 'x%'. It crashes, no debugger info. Where to find a 64bit bug-free midas? – Laszlo Jan 02 '14 at 20:46
  • 1
    Have you tried Strap='1*' ? * has been supported as wildcard character in filter for a long time. http://docwiki.embarcadero.com/RADStudio/XE3/en/Setting_the_Filter_Property – crefird Jan 02 '14 at 20:53
  • @Laszlo don't think it exists. You may try `uses MidasLib` - it is slightly different version and may by mere chance have no this problem. Same for xe4 dll. In theory I heard once RAD Studio cam with full c++ sources of DLL, but not heard anyone debugged them – Arioch 'The Jan 02 '14 at 21:12
  • can something like `'1' || Strap LIKE '11%'` be used to work around ? – Arioch 'The Jan 02 '14 at 21:14
  • @crefird Thanks for the suggestion, already tried. Not working. – Laszlo Jan 02 '14 at 21:20
  • @Arioch'The Have an idea. Two days ago, switched to a 64bit release (because of lack of memory), maybe that's why midas get mad. I am just trying the restaurate the old version. Hold on a minute. – Laszlo Jan 02 '14 at 21:25
  • FOUND !!! MIDAS.DLL GO OFF ON THE 64BIT PLATFORM. ON 32BIT ALL THE FILTER PATTERNS WORK, AS I TESTED DAYS AGO. TURNING TO 64BIT MIDAS IS MESSING UP **SOME** FILTER PATTERNS! – Laszlo Jan 02 '14 at 21:50
  • Thank you to everybody, especially to Arioch'The ! Will try to find a working 64bit midas version, but, as I understand, small chances. Thank you again. – Laszlo Jan 02 '14 at 21:56
  • @Arioch'The Give me please an answer, with your explanations, to could accept it. Thank you again! – Laszlo Jan 02 '14 at 22:09
  • Did you tried MidasLib unit instead of DLL? Or modified filter? I don't feel we solved the Issue yet. Then, could you make SSCCE.org for the issue and register on QC? PS and at least you would have to learn loading custom DLL rather than registry-registered one – Arioch 'The Jan 03 '14 at 12:39
  • Something I don't understand. In my uses clause is included midaslib, but still need the dll file in my system32 and syswow64 windows folder! – Laszlo Jan 03 '14 at 16:20
  • More of that, despite that is included, the dll file must be present and registered on every computer I try to run my program. In other case is NOT working. – Laszlo Jan 03 '14 at 16:29
  • What you mean by "MidasLib unit instead of DLL". I need both to run my program. Is there another method? – Laszlo Jan 03 '14 at 16:31
  • Regarding the filters I found that instead of **LIKE 'x%'** which not works, **='x*'** works! So it remains only the **'%xx'** filter pattern which gives an error in any case, for the 64bit platform. I could live with that, until somebody will fix this bug in midas. – Laszlo Jan 03 '14 at 16:39
  • @crefird Apologizes! Actually, your idea works! Thank you. – Laszlo Jan 03 '14 at 17:23
  • Meantime found another strange behaviour: For the SAME program and data, the 64 bit version is NOT seeing the data on a MAPPED drive, while the 32 bit version is working fine! On a local drive both are working! These things make me crazy! – Laszlo Jan 16 '14 at 10:00

2 Answers2

1

If during installation of Delphi XE5 you have choosen to install the old and ugly BDE, it will install you an old midas.dll library (date 8/9/2002) on system directory (check Windows\system32 or Windows\SysWOW64 depending on 32 or 64 bits Windows)

You must replace (or better delete) this old midas.dll and use the right version which comes with Delphi. You will find it at the Program files (x86)\embarcadero\rad studio\12.0\redist\win32 directory.

pakito
  • 11
  • 1
  • Thank you for the idea. Already have everywhere the midas.dll coming with Delphi. Anyhow, since I included in the uses clause the MidasLib, the executable has no need for any midas.dll from the system. Or it does? – Laszlo Jan 09 '14 at 22:48
0

midas.dll is a self-registering dll, so it is registered the first time is used and no matter if you include or copy to the same directory of your App, you must replace every old midas.dll from you system or check in Windows registry where it is registered

pakito
  • 11
  • 1
  • Thank you, will check the registry. – Laszlo Jan 11 '14 at 20:01
  • Meantime found another strange behaviour: For the SAME program and data, the 64 bit version is NOT seeing the data on a MAPPED drive, while the 32 bit version is working fine! On a local drive both are working! These things make me crazy! – Laszlo Jan 16 '14 at 09:56