odbc-wlx: plugin to view Access, Excel and DSN files

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

little-brother
Junior Member
Junior Member
Posts: 43
Joined: 2021-09-27, 10:27 UTC

odbc-wlx: plugin to view Access, Excel and DSN files

Post by *little-brother »

Hi!

Here is my second plugin for Lister to view Access (*.mdb, *.accdb), Excel (*.xls, *.xlsx, *.xlsb) and Data Source (*.dsn) files through ODBC interface. 64-bit version requires Microsoft Access Database Engine 2010 Redistributable or 2016.

Image: https://raw.githubusercontent.com/little-brother/odbc-wlx/main/odbc-wlx.png

Features
  • Column filters: "contains" (ABC), "exclude" (!ABC), "equals" (=ABC), "greater" (>ABC), "less" (<ABC)
  • Sort data by column click
  • Free and open-source
Project page - https://github.com/little-brother/odbc-wlx
Download link - https://github.com/little-brother/odbc-wlx/releases/latest/download/odbc-wlx.zip

P.S. Since 11-11-2021 csv support was removed to csvtab plugin.
Last edited by little-brother on 2021-11-11, 15:59 UTC, edited 1 time in total.
User avatar
blacky
Senior Member
Senior Member
Posts: 311
Joined: 2003-02-07, 16:58 UTC
Location: was das/whot's dath ?

Re: odbc-wlx: plugin to view Access, Excel and CSV files

Post by *blacky »

nice, thank you :)

a small hint:
{plg}-{for}-{version}-{achitectures}.{ext}
wlx-odbc-0.9.0-x86+x86_64.zip

therewith is more better for archiving and view directly what's going on..

i like both mysql viewer and odbc .. grate idea, thank you for it :))))))
keep it up !

best
Blacky
Meine Blackysgate.de/net
Ma' Personal licence : already one. Hab auch eine
Mein Computer : Einer/once ??? bahh, Rz/Data Centre !
Kitchen, Liv.room, TV, Schlafz.. Sch...
BS/OS: Win3.1/7, Fedora a. other, Reactos
little-brother
Junior Member
Junior Member
Posts: 43
Joined: 2021-09-27, 10:27 UTC

Re: odbc-wlx: plugin to view Access, Excel and CSV files

Post by *little-brother »

a small hint
Thanks, I'll use this pattern for the next release on wincmd.ru/totalcmd.net pages.
For git I prefer to keep it simple for an always actual link.
User avatar
Gral
Power Member
Power Member
Posts: 1460
Joined: 2005-01-26, 15:12 UTC

Re: odbc-wlx: plugin to view Access, Excel and CSV files

Post by *Gral »

Please, don't do that!
Don't use this "microsoft way", just name it x32 and x64 - look what we are used to - http://www.ghisler.com/plugins.htm http://totalcmd.net/
Also my hint - don't include -wlx in the file name - wlx extension is enough, so your plugin file may have a simpler name - odbc.wlx
little-brother
Junior Member
Junior Member
Posts: 43
Joined: 2021-09-27, 10:27 UTC

Re: odbc-wlx: plugin to view Access, Excel and CSV files

Post by *little-brother »

what we are used to
Since my package includes both x32 and x64 versions, the plugin already has the same name as others.
don't include -wlx in the file name
I know it looks clumsy but I'm going to use one pattern for all my plugins e.g. sqlite-wlx, odbc-wlx, <another-one-type>-wlx.
I can't use sqlite.wlx because this name is a very similar to official extension but it doesn't.
User avatar
blacky
Senior Member
Senior Member
Posts: 311
Joined: 2003-02-07, 16:58 UTC
Location: was das/whot's dath ?

Re: odbc-wlx: plugin to view Access, Excel and CSV files

Post by *blacky »

Meine Blackysgate.de/net
Ma' Personal licence : already one. Hab auch eine
Mein Computer : Einer/once ??? bahh, Rz/Data Centre !
Kitchen, Liv.room, TV, Schlafz.. Sch...
BS/OS: Win3.1/7, Fedora a. other, Reactos
User avatar
blacky
Senior Member
Senior Member
Posts: 311
Joined: 2003-02-07, 16:58 UTC
Location: was das/whot's dath ?

Re: odbc-wlx: plugin to view Access, Excel and CSV files

Post by *blacky »

microsoft way ?.. bahh, please don't use the Gral-way if i have in my filesystem a file names "odbc" do i don't know where i can allocate and delete some lil' file shortly as admin.. Better more information in the name as too few..

@Gral: one letter, is enough ? (bah bullschit !)

best regards to you little-Brother :)
Blacky
Meine Blackysgate.de/net
Ma' Personal licence : already one. Hab auch eine
Mein Computer : Einer/once ??? bahh, Rz/Data Centre !
Kitchen, Liv.room, TV, Schlafz.. Sch...
BS/OS: Win3.1/7, Fedora a. other, Reactos
little-brother
Junior Member
Junior Member
Posts: 43
Joined: 2021-09-27, 10:27 UTC

Re: odbc-wlx: plugin to view Access, Excel and CSV files

Post by *little-brother »

I tried to publish a new release with your template plugname-x.y.z-x86+x86_64.zip but totalcmd.net doesn't allow use +. So I rejected binary versions.
User avatar
chandragor
Member
Member
Posts: 118
Joined: 2005-06-01, 10:10 UTC
Location: Italy

Re: odbc-wlx: plugin to view Access, Excel and CSV files

Post by *chandragor »

Sorry to bother you, but this mode of handling keyboard keys is HORRIBLE:

RegisterHotKey(hMainWnd, IDH_EXIT, 0, VK_ESCAPE);
RegisterHotKey(hMainWnd, IDH_NEXT, 0, VK_TAB);
RegisterHotKey(hMainWnd, IDH_PREV, MOD_CONTROL, VK_TAB);

By doing so you capture ESCAPE, TAB and Ctrl-TAB for every window, not for your lister only.

Try opening Notepad and press TAB and the cursor will move.
Now try opening a csv, access or excel file in TC, switch to notepad and press again TAB: now the cursor will NOT move AND TAB is sent to your plugin window.....
The same will happen to ESC and Ctrl-TAB.

As long as one keeps your plugin open, no other window will receive any of the keys you registered as hotkey.

Apart from this, I do love this plugin! :D
My best regards (if I seemed angry or spiteful, I assure you I wasn't)
Happy owner of license #12422 since 1997
little-brother
Junior Member
Junior Member
Posts: 43
Joined: 2021-09-27, 10:27 UTC

Re: odbc-wlx: plugin to view Access, Excel and CSV files

Post by *little-brother »

Thanks for the report! This is a critical bug and it should be fixed in all my plugins.

P.S. 22/10/2021 Fixed.
User avatar
chandragor
Member
Member
Posts: 118
Joined: 2005-06-01, 10:10 UTC
Location: Italy

Re: odbc-wlx: plugin to view Access, Excel and DSN files

Post by *chandragor »

Hi.

Why default list separator is not used in csvtab plugin instead of fixed value of comma ?
I know i can change it by right clicking on status bar and selecting it, but why always ?
It can be easily retrieved by calling

GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SLIST, szBuf, sizeof(szBuf))

Or you can add it as an option in default.ini (though this can be difficult for semicolon as it is the marker for comments...)

My best regards.
Happy owner of license #12422 since 1997
little-brother
Junior Member
Junior Member
Posts: 43
Joined: 2021-09-27, 10:27 UTC

Re: odbc-wlx: plugin to view Access, Excel and DSN files

Post by *little-brother »

The separator is detected automatically. In your case the detector works incorrect. Could you send some examples to me at lb-im@ya.ru?
User avatar
chandragor
Member
Member
Posts: 118
Joined: 2005-06-01, 10:10 UTC
Location: Italy

Re: odbc-wlx: plugin to view Access, Excel and DSN files

Post by *chandragor »

Hi again.

I noticed that indeed it is the separator which is not automatically detected.
I have a file with the column headers in the first line which is correctly detected,
while another file, without headers, which is not, probably because one of the colums
contains a decimal number which uses comma as decimal separator, as it is nomal for
Italian numeric format.

It seems that your detector feels that comma as separator and doesn't recognize semicolumn.

Still I ask: why don't you stick with system default ?

By the way, lots of the csv I process, coming from third parts, are usually without headers and with decimals inside.

Regards.
Happy owner of license #12422 since 1997
little-brother
Junior Member
Junior Member
Posts: 43
Joined: 2021-09-27, 10:27 UTC

Re: odbc-wlx: plugin to view Access, Excel and DSN files

Post by *little-brother »

It seems that your detector feels that comma as separator and doesn't recognize semicolumn
The detector counts possible delimiters in first rows. Each rows should have similar count.
If counts are equal then comma is choosen as first matched.
In your case there are two candidats: comma and semicolon. They both have fixed counts for each row and therefore they are equal.
This heuristics should be refine.
Still I ask: why don't you stick with system default ?
There is no system default for csv-format. GetLocaleInfo returns the default delimiter for any items of OS. But OS doesn't generate csv itself.
There are a lot csv-like files that the plugin tries to support. And using a fixed or system delimiter is a not good idea, imho.
User avatar
chandragor
Member
Member
Posts: 118
Joined: 2005-06-01, 10:10 UTC
Location: Italy

Re: odbc-wlx: plugin to view Access, Excel and DSN files

Post by *chandragor »

There is no system default for csv-format. GetLocaleInfo returns the default delimiter for any items of OS. But OS doesn't generate csv itself.
Of course, but Excel and similar programs create csv and they use system delimiter, unless otherwise specified.
Therefore it is better to stick with system delimiter, at least if your heuristic detects multiple candidates.

Comma is a "difficult" delimiter: think of a csv containig addresses with civic number, e.g. Courier Plaza, 25
Just counting commas is wrong, and usually these columns SHOULD BE enclosed in quotes, otherwise even Excel
fails at showing them correctly if comma delimiter is used.

Or, as in my case, a csv containing many numbers with decimals in a format other than the Anglo-saxon one.

Regards.
Happy owner of license #12422 since 1997
Post Reply