MySQL and HMG

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
Rathinagiri
Posts: 5480
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: MySQL and HMG

Post by Rathinagiri »

For me it is working fine Sudip. I don't know where could be the error. :(

Can you send the back up of .sql file with some lines of data?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: MySQL and HMG

Post by sudip »

Hello Rathi,

I am sending some codes which will automatically create a database, Info and a table Accyr.

Now please add an accounting year in "Accounting Year" form by pressing Ctrl+A. Save it. Close the program and try to run the software again.

Please download
InfoSql.zip
(13.76 KiB) Downloaded 315 times
Please note that these codes are unfinished.

TIA.

With best regards.

Sudip
With best regards,
Sudip
User avatar
Rathinagiri
Posts: 5480
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: MySQL and HMG

Post by Rathinagiri »

Hi Sudip,

Please update the query function with the following code:

Code: Select all

function sql(dbo1,qstr)
   local i, j
   local table := nil
   local currow := nil
   local tablearr := {}
   local rowarr := {}
   local curdateformat := set(_SET_DATEFORMAT)
   set date ansi
   table := dbo1:query(qstr)
   if table:neterr()
      msgstop(table:error())
      table:destroy()
      set(_SET_DATEFORMAT,curdateformat)
      return tablearr
      
   else
      if table:lastrec() > 0
         asize(tablearr,0)
         for i := 1 to table:lastrec()
            asize(rowarr,0)
            currow := table:getrow(i)
            for j := 1 to table:fcount()
               aadd(rowarr,currow:fieldget(j))
               //msgbox(currow:fieldget(j))
            next j
	         aadd(tablearr,aclone(rowarr))
         next i
      endif
      table:destroy()
      set(_SET_DATEFORMAT,curdateformat)
      return tablearr
   endif
return tablearr
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: MySQL and HMG

Post by sudip »

Hi Rathi,
Thanks a lot! Problem is solved.
With best regards.
Sudip
With best regards,
Sudip
Post Reply