Author Topic: libdb (SQLite / MySQL / MariaDB / PostgreSQL / ODBC library)  (Read 17380 times)

0 Members and 1 Guest are viewing this topic.

Offline Mighty

  • Camper
  • ***
  • Posts: 276
Re: libdb (ODBC / SQLite / PostgreSQL library for Windows/Linux servers)
« Reply #20 on: November 30, 2012, 08:01:19 am »
Sadly, empty string :(
xFire: macmil        e-mail: macekmil@gmail.com
My scripts: Accuracy Script       Flashbang       Punishments GUID
            CatchMe Gamemod       AntiFake
            CW System             AntiFakeGUID

Offline SyavX

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 338
Re: libdb (ODBC / SQLite / PostgreSQL library for Windows/Linux servers)
« Reply #21 on: November 30, 2012, 10:51:21 am »
Now I'm out of ideas too...

Offline ExHunter

  • Inactive Soldat Developer
  • Soldier
  • ******
  • Posts: 154
  • Speedy go!
Re: libdb (ODBC / SQLite / PostgreSQL library for Windows/Linux servers)
« Reply #22 on: December 11, 2012, 03:43:03 pm »
Hey,

We also encountered some problems with the ODBC drivers/connectors... We are able to run the server with the library, but we do not get any drivers installed..

System info and what we tried to do to get it work:
Quote
CentOS 5.8
libiodbc completely installed (also re-installed)
$LD_LIBRARY_PATH correct
mysql-connector-odbc installed 3.51 64b
tested with
mysql-connector-odbc 5.2 64b
3.51 32b and 5.2 32b

looking for drivers:
Quote
(20:12:17) /drivers (*.*.*.*)
(20:12:17) No ODBC drivers installed!

trying to connect to a db DB_error() shows:
Quote
(20:12:22) Data source name not found and no default driver specified. Driver could not be loaded


What possibilities do we have to get the driver loaded? I would appreciate any help, since we cannot think of anything more than that now. Thanks ;)

Offline SyavX

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 338
Re: libdb (ODBC / SQLite / PostgreSQL library for Windows/Linux servers)
« Reply #23 on: December 12, 2012, 03:34:23 am »
I've updated the libdb (check attachments in the 1st post), so it's Linux version requires unixODBC instead of iODBC now. Maybe it would help to solve the problems mentioned above.

ExHunter, unfortunately I'm not experienced with Linux enough, but I could suggest you to read this first: Configuring MySQL Connector/ODBC
and, since libdb was updated, this: Guide to getting unixODBC and MySQL/MyODBC working.

Also, you could try Mr's SoldatSOCI.
« Last Edit: December 12, 2012, 08:10:59 am by SyavX »

Offline Szaman

  • Soldier
  • **
  • Posts: 145
Re: libdb (ODBC / SQLite / PostgreSQL library for Windows/Linux servers)
« Reply #24 on: August 10, 2013, 05:16:58 pm »
Hi,

I have some problems with compiling libdb on server (1.6.5 version, Debian hosted) :(

When I try to compile it there is an error:
►   00:13:31 
  • Compiling libdb-0.2 -> libdb_linux.pas...

►   00:13:31 
  • libdb-0.2 -> [Error] (23:1): Semicolon (';') expected

►   00:13:31 
  • Disabling libdb-0.2


Line 23 is:
Function DB_ColumnName(DatabaseID, Column: Integer): PChar;

Does anybody had the same problem and solved it ?

Thanks in advace for the response.

Best regards,
Peter.

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: libdb (ODBC / SQLite / PostgreSQL library for Windows/Linux servers)
« Reply #25 on: August 10, 2013, 07:05:24 pm »
you have safemode off. Launch soldatserver with -safe 0 switch.
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline Szaman

  • Soldier
  • **
  • Posts: 145
Re: libdb (ODBC / SQLite / PostgreSQL library for Windows/Linux servers)
« Reply #26 on: August 11, 2013, 04:44:54 am »
Oh... such a stupid bug  :-\ Sorry for wasting your time  :(

And thank you very much for explaining that error :) Now everything works :)

Offline Leader

  • Major(1)
  • Posts: 9
Re: libdb (ODBC / SQLite / PostgreSQL library for Windows/Linux servers)
« Reply #27 on: January 14, 2015, 01:02:29 am »
Hello there! Ive got a problem! I try to learn database scripting. I started it connecting databasing with script core2 and it works with safe 0. But Id like to move to script core 3 and I cannot. When I recompile trial script I get an error like when it would be sc2 with safe on "Semicolon expected". Could someone tell me what should I install/change/remove or anything?

Offline SyavX

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 338
Re: libdb (ODBC / SQLite / PostgreSQL library for Windows/Linux servers)
« Reply #28 on: January 14, 2015, 04:01:36 am »
Try to enable external DLLs in ScriptCore3 config file: AllowDlls=1

Offline Nedi

  • Major(1)
  • Posts: 45
Re: libdb (ODBC / SQLite / PostgreSQL library for Windows/Linux servers)
« Reply #29 on: May 06, 2015, 07:28:38 am »
Hello,
I have some problems with running soldatserver with this lib:

Code: [Select]
             -= Soldat Dedicated Server 1.6.8 - 2.7.8 =-

----------------------------------------------------------------
         Soldat Dedicated Server initializing...
----------------------------------------------------------------

   Need help running your server?
   IRC: #soldat.devs @ irc.quakenet.org

   ---> http://soldatforums.com/

   Additional parameters:
   ./soldatserver -p PORT -l MAXPLAYERS -k PASSWORD
   Example: ./soldatserver -p 23073 -l 16 -k "my pass"


 Compiled with FreePascal (Indy 10)

 Hit CTRL+C to Exit
 Please command the server using the Soldat Admin program
Welcome to Soldat 1.6.8
 Server name: Soldat Server
 Server PID: 6217
 [*] Compiling stats -> libdb_linux.pas...
 [*] Compiling stats -> stats.pas...
 [*] stats -> Cannot Import dll:libdb-0.2.so
 [*] Disabling stats
----------------------------------------------------------------
Mapslist loaded mapslist
ctf_nothard
 Server IP: 0.0.0.0 Port: 23073
 Connection for file server started. Port: 23083
Registering server @ 67.23.118.179


I have debian 7 64bit
libdb-0.2.so is placed in soldatserver root folder
also in:
/var/lib/libdb-0.2.so
/etc/lib/libdb-0.2.so
/lib64/libdb-0.2.so
/lib/libdb-0.2.so
/usr/local/lib/libdb-0.2.so
/usr/lib/libdb-0.2.so

Do you have any ideas why it doesn't work?

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5016
Re: libdb (ODBC / SQLite / PostgreSQL library for Windows/Linux servers)
« Reply #30 on: May 06, 2015, 06:12:13 pm »
Hello,
I have some problems with running soldatserver with this lib:

Code: [Select]
             -= Soldat Dedicated Server 1.6.8 - 2.7.8 =-

----------------------------------------------------------------
         Soldat Dedicated Server initializing...
----------------------------------------------------------------

   Need help running your server?
   IRC: #soldat.devs @ irc.quakenet.org

   ---> http://soldatforums.com/

   Additional parameters:
   ./soldatserver -p PORT -l MAXPLAYERS -k PASSWORD
   Example: ./soldatserver -p 23073 -l 16 -k "my pass"


 Compiled with FreePascal (Indy 10)

 Hit CTRL+C to Exit
 Please command the server using the Soldat Admin program
Welcome to Soldat 1.6.8
 Server name: Soldat Server
 Server PID: 6217
 [*] Compiling stats -> libdb_linux.pas...
 [*] Compiling stats -> stats.pas...
 [*] stats -> Cannot Import dll:libdb-0.2.so
 [*] Disabling stats
----------------------------------------------------------------
Mapslist loaded mapslist
ctf_nothard
 Server IP: 0.0.0.0 Port: 23073
 Connection for file server started. Port: 23083
Registering server @ 67.23.118.179


I have debian 7 64bit
libdb-0.2.so is placed in soldatserver root folder
also in:
/var/lib/libdb-0.2.so
/etc/lib/libdb-0.2.so
/lib64/libdb-0.2.so
/lib/libdb-0.2.so
/usr/local/lib/libdb-0.2.so
/usr/lib/libdb-0.2.so

Do you have any ideas why it doesn't work?

Can you paste the output of "ldd libdb-0.2.so" in your soldat's root folder?
Careful with that axe, Eugene.

Offline SyavX

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 338
Re: libdb (ODBC / SQLite / PostgreSQL library for Windows/Linux servers)
« Reply #31 on: May 07, 2015, 05:36:20 am »
Hello,
I have some problems with running soldatserver with this lib:

Seems like there is something wrong with server compiled with Indy 10, try to run soldatserver_legacy

Btw, I've updated notes section to make it more specific about dependencies.

Offline Nedi

  • Major(1)
  • Posts: 45
Re: libdb (ODBC / SQLite / PostgreSQL library for Windows/Linux servers)
« Reply #32 on: May 07, 2015, 11:35:53 am »
Can you paste the output of "ldd libdb-0.2.so" in your soldat's root folder?
There was:
Code: [Select]
libodbc.so.1 => not found
Btw, I've updated notes section to make it more specific about dependencies.
It works now

Thanks

Offline Walls

  • Major(1)
  • Posts: 5
Re: libdb (ODBC / SQLite / PostgreSQL library for Windows/Linux servers)
« Reply #33 on: June 17, 2015, 08:24:19 am »
Yeah, I was going to make a note on that all deps must be 32bits, took quite a while for exhunter and me to get it working on our servers.
So it shall work on other distros as long as you get all odbc and deps on 32b.

Offline SyavX

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 338
Re: libdb (SQLite / MySQL / MariaDB / PostgreSQL / ODBC library)
« Reply #34 on: January 27, 2019, 09:09:50 am »
Version 0.3 (27 Jan 2019):
+ Added MySQL support (see DB_Plugin_MySQL)
+ Added SQL bind variables (see DB_SetString(), DB_SetLong() etc.)
+ Added things which I can't recall...
% Modified library bindings and example code (rewritten with ScriptCore3 syntax)
% Modified some bindings and internal code which broke backward compatibility, see description below for more info

1. Most functions that were returning non zero on success and 0 otherwise are returning Boolean now (e.g. DB_NextRow(), DB_Query() etc.)
For example:
Code: (Pascal) [Select]
if DB_NextRow(0) <> 0 then
// and
if DB_NextRow(0) = 0 then

should be replaced with
Code: (Pascal) [Select]
if DB_NextRow(0) then
// and
if not DB_NextRow(0) then

2. You should now call one of DB_UseMySQL(), DB_UseODBC(), DB_UsePostgreSQL(), DB_UseSQLite() procedures before using any functions related to the corresponding database plugins.

3. Database plugins and column type constants are declared as enumerations now:
Code: (Pascal) [Select]
{ Database plugins enumeration for the DB_Open() function }
type TDatabasePluginType = (DB_Plugin_Undefined, DB_Plugin_ODBC, DB_Plugin_SQLite, DB_Plugin_PostgreSQL, DB_Plugin_MySQL);

{ Database column types enumeration for the DB_ColumnType() function }
type TDatabaseColumnType = (DB_Type_Undefined, DB_Type_Long, DB_Type_String, DB_Type_Float, DB_Type_Double, DB_Type_Quad);


See first post for the download link...
« Last Edit: February 05, 2019, 04:00:15 pm by SyavX »

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5016
Re: libdb (SQLite / MySQL / MariaDB / PostgreSQL / ODBC library)
« Reply #35 on: January 30, 2019, 07:31:12 pm »
Nice addition of the bind variables! Great to finally have prepared statements.
Careful with that axe, Eugene.

Offline Savage

  • Soldier
  • **
  • Posts: 147
Re: libdb (SQLite / MySQL / MariaDB / PostgreSQL / ODBC library)
« Reply #36 on: February 10, 2019, 08:40:47 am »
Amazing work  ;)