Mysql Error In EasyCode But Not Radasm

Started by devilhorse, November 24, 2010, 01:14:29 AM

Previous topic - Next topic

devilhorse

I have learning how to program Mysql applications in EasyCode instead of C++. I have run into a particular problem that only happens with EasyCode IDE. Whenever I run the PracticeInsertData procedure below I get a messagebox with the following error information:

EasyCode - Application Error
Code:     80000003H
Description: BREAKPOINT
Exception Address: 40155BH

I have ported this code to Radasm andl I do not get any errors when using Radasm. Any suggestions? I prefer to use EasyCode otherwise I might as well code it in C++ :(

.Data
;connection params
host Byte  "localhost", 0
user Byte  "TestUser", 0          ;test user name for connecting to Mysql server
pass Byte "TestPassWord", 0   ;test password for connecting to Mysql server
database Byte "practice", 0     ;test database name
mysql_object MYSQL <>
szMysql_Init  DB   "mysql_init", 0
UserInsert Byte "insert into usertable.users (username,pswd) values ('John', 'Doe')", 0


.Data?
connection DWord ? ;handle to Mysql datatabase connection

.Proc

Connect2Mysql Proc
Invoke mysql_init, Addr mysql_object
Mov connection, Eax

.If connection != NULL
   Invoke SetText, App.Main, CTXT("Connected To Mysql Server")
   Invoke mysql_real_connect, connection, Addr host, Addr user, Addr pass, Addr database, 3306, NULL, 0
   .If Eax == NULL
      Invoke mysql_error, connection
      Mov Esi, Eax
      Invoke MessageBox, NULL, Esi, CTXT("mysql_real_connect_error"), MB_OK
         .Else
      .EndIf
.EndIf
   Ret
Connect2Mysql EndP


PracticeInsertData Proc
   
Invoke mysql_real_query, connection, Addr UserInsert, SizeOf UserInsert
.If Eax != 0
Invoke mysql_error, connection
      Mov Esi, Eax
      Invoke MessageBox, NULL, Esi, CTXT("Insert Data Error"), MB_OK
Return FALSE
   .EndIf
PracticeInsertData EndP

devilhorse

Accidently erased the "Ret" at the end of the function  :naughty:


PracticeInsertData Proc
   
Invoke mysql_real_query, connection, Addr UserInsert, SizeOf UserInsert
.If Eax != 0
Invoke mysql_error, connection
      Mov Esi, Eax
      Invoke MessageBox, NULL, Esi, CTXT("Insert Data Error"), MB_OK
Return FALSE
   .EndIf
Ret :bdg :bdg :bdg
PracticeInsertData EndP

vanjast

I happens to me too, sometimes the most obvious things are jumping up and down in front of you... and you don't see it... :bg