Author Topic: Caballero's drawer  (Read 51169 times)

caballero

  • Member
  • *****
  • Posts: 2028
  • Matrix - Noah
    • abre ojos ensamblador
DynSky in a Torus
« Reply #120 on: November 29, 2020, 11:03:02 PM »
Looking at some old code, I have slightly modified this torus to give the clouds movement in the torus. With a light background music.
The logic of the error is hidden among the most unexpected lines of the program

caballero

  • Member
  • *****
  • Posts: 2028
  • Matrix - Noah
    • abre ojos ensamblador
ODBC DB Accessing example
« Reply #121 on: December 26, 2020, 01:05:00 AM »
Hello, this days I'm doing some examples on ODBC accesing to db, access and oracle. I have already had success, and now I am rewriting the code to polish it.

The mdb accessing has this look:
Code: [Select]
>fasm_access
mdb ODBC connection successful
KING    PRESIDENT
BLAKE   MANAGER
CLARK   MANAGER
JONES   MANAGER
FORD    ANALYST
SMITH   CLERK
ALLEN   SALESMAN
WARD    SALESMAN
MARTIN  SALESMAN
TURNER  SALESMAN
JAMES   CLERK
MILLER  CLERK
Disconnect successful

For it, I have made previously a mdb db with the Oracle alike emp table, whose structure is this:
Code: [Select]
create table emp( 
  empno    number(4,0), 
  ename    varchar2(10), 
  job      varchar2(9), 
  mgr      number(4,0), 
  hiredate date, 
  sal      number(7,2), 
  comm     number(7,2), 
  deptno   number(2,0), 
  constraint pk_emp primary key (empno), 
  constraint fk_deptno foreign key (deptno) references dept (deptno) 
);

Instead of using Microsoft Access, I have used MDB Viewer Plus, that is a free mdb viewer and editing tool. And I have fed it with some data.

I will rewrite then the oracle example.
The logic of the error is hidden among the most unexpected lines of the program

TimoVJL

  • Member
  • *****
  • Posts: 1226
Re: Caballero's drawer
« Reply #122 on: December 26, 2020, 02:59:18 AM »
As i sometimes use oracle SQORA32.dll directly, i needed a modified odbc32.def files.
May the source be with you

caballero

  • Member
  • *****
  • Posts: 2028
  • Matrix - Noah
    • abre ojos ensamblador
Re: Caballero's drawer
« Reply #123 on: December 26, 2020, 04:21:00 AM »
Using the code to access mdb, already more structured, the access to oracle gives me an error, but debugging it goes fine  :rolleyes:. Well, not everything was going to be easy.
The logic of the error is hidden among the most unexpected lines of the program

caballero

  • Member
  • *****
  • Posts: 2028
  • Matrix - Noah
    • abre ojos ensamblador
Re: Caballero's drawer
« Reply #124 on: December 26, 2020, 05:47:33 AM »
You aren't going to believe it  :toothy:  I had fixed some bugs but I have missed an "int 3" in the code to debug it, that's what failed, removed it and everything seems to go right with the Oracle ODBC conn. I have made it in fasm, I'm going to do it also en others compilers.

Well, right, everything is ok now  :thumbsup:

Code: [Select]
E:\>fasm_oracle
Oracle ODBC connection successful
KING    PRESIDENT
BLAKE   MANAGER
CLARK   MANAGER
JONES   MANAGER
SCOTT   ANALYST
FORD    ANALYST
SMITH   CLERK
ALLEN   SALESMAN
WARD    SALESMAN
MARTIN  SALESMAN
TURNER  SALESMAN
ADAMS   CLERK
JAMES   CLERK
MILLER  CLERK
Disconnect successful
The logic of the error is hidden among the most unexpected lines of the program

caballero

  • Member
  • *****
  • Posts: 2028
  • Matrix - Noah
    • abre ojos ensamblador
Re: Caballero's drawer
« Reply #125 on: December 26, 2020, 10:43:57 PM »
Playing with windows properties I realized some years ago that it could be possible to exchange the title bar place with the windows button places. Up till W7, in W10 I have realized that is not longer possible. Just a curiosity  :bgrin:

I have this code for masm also and c in mi web page. I attached the fasm version that is what I was looking at now.

** Warning. Hitting any button do something like hiding the taskbar and others, hitting the same button again restores the original form.
The logic of the error is hidden among the most unexpected lines of the program

jj2007

  • Member
  • *****
  • Posts: 13280
  • Assembly is fun ;-)
    • MasmBasic
Re: Caballero's drawer
« Reply #126 on: December 26, 2020, 10:48:07 PM »
No source?
Masm32 Tips, Tricks and Traps

Some members can't live without insulting others. It tells us a lot about them.

caballero

  • Member
  • *****
  • Posts: 2028
  • Matrix - Noah
    • abre ojos ensamblador
Re: Caballero's drawer
« Reply #127 on: December 26, 2020, 10:51:51 PM »
The code is just above the image, also in my webpage

http://abreojosensamblador.epizy.com/?Tarea=6&SubTarea=3#Taskbar
The logic of the error is hidden among the most unexpected lines of the program

jj2007

  • Member
  • *****
  • Posts: 13280
  • Assembly is fun ;-)
    • MasmBasic
Re: Caballero's drawer
« Reply #128 on: December 26, 2020, 11:55:46 PM »
The code is just above the image, also in my webpage

http://abreojosensamblador.epizy.com/?Tarea=6&SubTarea=3#Taskbar

"Masm codigo" gives a 404. The attachment above is a standard windows template, it does not cover your taskbar demo.
Masm32 Tips, Tricks and Traps

Some members can't live without insulting others. It tells us a lot about them.

caballero

  • Member
  • *****
  • Posts: 2028
  • Matrix - Noah
    • abre ojos ensamblador
Re: Caballero's drawer
« Reply #129 on: December 27, 2020, 03:35:57 AM »
When the page says "error 404" is because it doesn't find the object linked. In this case, it was my fault, I didn't write the "W" in "TaskWM01.asm". The source attached above is complete, you may drag and drop in the fasm editor and compile with F9, that's all, I just missed the "a.ico" file in the zip that is used in the source. Anyway, it should work the link now in my web page.
The logic of the error is hidden among the most unexpected lines of the program

caballero

  • Member
  • *****
  • Posts: 2028
  • Matrix - Noah
    • abre ojos ensamblador
Re: Caballero's drawer
« Reply #130 on: December 27, 2020, 03:37:23 AM »
I have started (but not completed) the Windows version of Oracle ODBC in fasm.

The logic of the error is hidden among the most unexpected lines of the program

TimoVJL

  • Member
  • *****
  • Posts: 1226
Re: Caballero's drawer
« Reply #131 on: December 27, 2020, 03:51:30 AM »
For oracle timestamp
Code: [Select]
TO_CHAR(HIREDATE,\'DD.MM.YYYY\') AS HireDateor just cut it shorter ?
May the source be with you

jj2007

  • Member
  • *****
  • Posts: 13280
  • Assembly is fun ;-)
    • MasmBasic
Re: Caballero's drawer
« Reply #132 on: December 27, 2020, 04:54:01 AM »
Playing with windows properties I realized some years ago that it could be possible to exchange the title bar place with the windows button places. Up till W7, in W10 I have realized that is not longer possible. Just a curiosity  :bgrin:

Cute :thumbsup:

But are you sure that subtracting WS_EX_APPWINDOW from the current ex style is the correct way?
Code: [Select]
        wmBoton06:
          cmp       [vbInvertTitle], 0
          jnz       wmBtn06_01
            mov       [vbInvertTitle], 1
            invoke    SetWindowText, [hBtn7], offset szRetaurarTitle
            mov       eax, [hMiWndStyle]
            sub       eax, WS_EX_APPWINDOW
            invoke    SetWindowLong, [hWnd], GWL_EXSTYLE, eax
            jmp       wmFin
          wmBtn06_01:
            mov       [vbInvertTitle], 0
            invoke    SetWindowText, [hBtn7], offset szInvertirTitle
            invoke    SetWindowLong, [hWnd], GWL_EXSTYLE, [hMiWndStyle]
          jmp       wmFin

This works fine:
Code: [Select]
GuiParas equ "Press Ctrl T", w160, h100, icon Star, b Turquoise
include \masm32\MasmBasic\Res\MbGui.asm
Event Key
  .if VKey==VK_T
xor rv(GetWindowLong, hWnd_, GWL_EXSTYLE), WS_EX_LAYOUTRTL
invoke SetWindowLong, hWnd_, GWL_EXSTYLE, eax
  .endif
GuiEnd
Masm32 Tips, Tricks and Traps

Some members can't live without insulting others. It tells us a lot about them.

caballero

  • Member
  • *****
  • Posts: 2028
  • Matrix - Noah
    • abre ojos ensamblador
Re: Caballero's drawer
« Reply #133 on: December 27, 2020, 05:05:54 AM »
Hmmm, that's nice, I didn't know WS_EX_LAYOUTRTL = 0x0040 0000h = 100 0000 0000 0000 0000 0000b.  Now it works exchanging places for title bar and W-icons also in W10.  :thumbsup:

The key seems to be in that position of 1.
The logic of the error is hidden among the most unexpected lines of the program

caballero

  • Member
  • *****
  • Posts: 2028
  • Matrix - Noah
    • abre ojos ensamblador
Re: Caballero's drawer
« Reply #134 on: December 28, 2020, 07:38:57 AM »
One more step done. As you already know, to connect to Oracle via ODBC you need a system DSN connection string, a username and a password. Instead of putting it directly in the code, I have created a combobox that I feed with the connection strings already created in the ODBC data manager and a user box and another for the password. When the "Connect" button is pressed, read from there to establish the connection. Once connected, you can disconnect or extract the data and dump it to the listview. In the Fasm program I was doing, I was stucked retrieving the information from the system DSNs to feed the combobox, so I switched to Masm, where I have been successful. The image you see is from the MASM version.

With this, the basic version of the connection to Oracle would almost be there. what would be left to do:
Implement superclass to be able to navigate between text boxes and buttons using tab.
A basic help system indicating what each thing is


This will be the basis for my final goal, which is to make a program that reads from two access files: acc_old, acc_new, and from an oracle database. The structure of the access files replicates the structure of the oracle database. Inside here are some LONG/BLOB fields that hold some code. The acc_new brings news in this code, while acc_old contains the original that helps us to find what specific novelty it brings and implement it in oracle. With the added difficulty that in Oracle you may have made your own changes to this code. And, furthermore, this code is historicized.

Depending on what comes in acc_new I will search acc_old and oracle and download everything to different folders and text files that contain said texts and thus be able to compare them easier from text files.

I am considering the possibility of also generating a mariadb or sqlite database to save all the recovered data, such as the name of the code, who it depends on, and the start and end date of existence, for each of the environments.

If I don't get bored before, I have here for a long time.
The logic of the error is hidden among the most unexpected lines of the program