Page 1 of 1

Undefined function: sqlite3_open

Posted: Thu Nov 18, 2010 9:35 am
by karweru
Hi Friends,

I'm encountering the error above when my program executes the this line:

do("sqlite3_open", "accounts.db",.t.)
The purpose of calling sqlite3_open() this way is because i need to use NetIo RPC so that I can work on an sqlite database located on a remote pc.

I would greatly appreciate any help.

Re: Undefined function: sqlite3_open

Posted: Thu Nov 18, 2010 10:14 am
by Rathinagiri
It is working for me fine. What could be the problem then? Any file permission issues?

Re: Undefined function: sqlite3_open

Posted: Thu Nov 18, 2010 1:25 pm
by karweru
Hi Rathi,

Thanks for your time and effort. I'm also confused. When i run the following sample

#include 'minigui.ch'
#include 'hbclass.ch'

FUNCTION MAIN()

DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 400 ;
HEIGHT 200 ;
TITLE 'RPC Test' ;
MAIN

DEFINE MAIN MENU
POPUP 'Test'
ITEM 'TEST RPC (1)' ACTION {||do("sqlite3_open","orgs.db",.t.)}
ITEM 'TEST RPC (2)' ACTION {||sqlite3_open("orgs.db",.t.)}
END POPUP
END MENU

END WINDOW
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
Return
It runs without a problem, which means also I don't have access rights issues.
However, when i remark out the line
ITEM 'TEST RPC (2)' ACTION {||sqlite3_open("orgs.db",.t.)}
the undefined function : sqlite3_open error comes up.

I would appreciate any insights you might have. Thank you so much again for your time.

Re: Undefined function: sqlite3_open

Posted: Thu Nov 18, 2010 1:55 pm
by sudip
Hello Gilbert,

I also don't have any problem with that function. Following code is working fine.

Code: Select all

   mRootDb := sqlite3_open(cRootDatabase, .t.)
   if mRootDb == nil
   	msgbox("Cannot Open/Create "+cRootDatabase)
   	return nil
   endif
Which version of HMG are you using?

I am using HMG 3.0.35. With HMG IDE, I don't need to add Sqlite library. You may also try with adding the library libhbsqlit3.a, from \HMG\HARBOUR\LIB

Thanks.

Re: Undefined function: sqlite3_open

Posted: Thu Nov 18, 2010 2:22 pm
by karweru
Hi Sudip,

Thanks for your response. I'm actually lost as to what the problem could be. I'm using the HMG version 3.0.35 (2010.06.20). I've 'resolved' the problem by including the dummy function below, which, though not called from anywhere in my program, seems to take out the problem.
FUNCTION force_sqlite_link()
sqlite3_open()
sqlite3_exec()
sqlite3_get_table()
sqlite3_prepare()
sqlite3_column_count()
sqlite3_column_decltype()
sqlite3_reset()
sqlite3_column_name()
sqlite3_errmsg()
sqlite3_errcode()
return
I've offloaded all minigui installations and even harbour and re-installed but to no avail. At this point, I have to believe the problem is with my environment, due to the fact that you and Rathi can't replicate the problem.

However, I'm grateful for your support.