Error: Object should first be initialized.

edgar_ortiz

Active Member
Licensed User
Longtime User
Hi,

I have a app that lose a DB object who was created en

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

This occurs after a "inactivity" time.

Any help is welcome

Regards,
Edgar
 

Attachments

  • Gps_Test.zip
    16.2 KB · Views: 206
  • Log.txt
    6.4 KB · Views: 186

mangojack

Expert
Licensed User
Longtime User
B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    '
    Dim DBGps            As SQL

B4X:
Sub Open_DataBase (Directorio As String, DBName As String)
   Dim lcResult As Boolean
   '
   If File.Exists(Directorio, DBName) = True Then
      ' Se abre la Base de Datos
      Main.DBGPS.Initialize(Directorio, DBName, False)
      If Main.DBGPS.IsInitialized = True Then

You have declared ' DBGps ' but then appear to Initialize ' DBGPS '.

Also on last line you then initialize DBGPS and immediately test if it is initialized ?

Cheers mj
 

Attachments

  • Capture.JPG
    Capture.JPG
    28.4 KB · Views: 204
Upvote 0

edgar_ortiz

Active Member
Licensed User
Longtime User
Thanks for your time.

Buyt B4A, is not case sensite in the name of variables.

Also the problem is given after several writes on the database.

Regards,

Edgar
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
Edgar . Yes correct Variables not case sensitive.
I added a dbgps.db3 to assets and the app runs OK.. I do not get initialization error ??

Cheers mj
 
Upvote 0

edgar_ortiz

Active Member
Licensed User
Longtime User
I appreciate your time,

I tested the app and the problem occurs when pass a good amount of time, apparently the "app" is killed and the "service" (gps) is alive. :BangHead:

By example... run others programs, and after 10 minutes, the program crash.

Again, thanks for your time.

If you can test the app... I appreciate.

Regards,

Edgar
 
Upvote 0
Top