Android Question [SOLVED]How i will connect to my MariaDB database using MSMariadb (getting Sub NOT FOUND: 'mysql_sta

Magma

Expert
Licensed User
Longtime User
Hi there - i am trying to connect to my Mariadb sql database... but..

I am getting this :
Sub NOT FOUND: 'mysql_status
not Connected to Database

Maybe didn;t understand well.. i am using the following to connect:

B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim db As MSMaria
end sub

and at activity_create :
B4X:
db.Initialize("MySQL","192.168.168.3:3036","root","mypass","nameofdatabase") 'MySQL is just a name for sub i believe...


Sub testButton1_Click
db.ExecuteASync("INSERT INTO tracking SET carid='" & carid & "', lat=11, lng=22, speed=33;","")
'tracking is a name of table...
End Sub


Where am i wrong ?




events has the example are the following (ive just copy-paste them):
B4X:
Sub MySQL_ExecResult(meta As Map)
   Log(meta)
End Sub
Sub MySQL_BatchResult(batch As Map)
   Log(batch)
End Sub
Sub MySQL_QueryResult(data As List, meta As Map)
   'Dim m As Map = meta
   Log("MySQL_QueryResult("&meta&")")
   For i=0 To data.Size-1
     'Log("r:"&data.Get(i))
   Next
End Sub
Sub MySQL_ListTables(tables As List, ms As Long)
   Log("MySQL_ListTables("&ms&"ms)")
   For i=0 To tables.Size-1
     'Log("Table "&tables.Get(i))
   Next
End Sub
 

DonManfred

Expert
Licensed User
Longtime User
Please use CODE TAGS when posting code
I already said that you need to add the missing event, right?
Why you did not add is manually? You are aware that you CAN DO this?
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
Upvote 0

Magma

Expert
Licensed User
Longtime User
db.Initialize("MySQL","192.168.168.3:3036","root","mypass","nameofdatabase") 'MySQL is just a name for sub i believe...

it's ok with event name but i am not connected to my db ... i want to connect through my lan... (already test with heidisql at other pc - works)
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Again: use code tags when posting code!
B4X:
db.Initialize("MySQL","192.168.168.3:3036","root","mypass","nameofdatabase") 'MySQL is the PREFIX of ALL Events of the Lib

->

B4X:
Sub MySQL_Status(Connected As Boolean, ReConnecting As Boolean, RetriesLeft As Int)
End Sub

Please note that the IP is only accessible from the local network.
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
Upvote 0
Top