#1 2015-12-28 09:04:02

RaelB
Member
Registered: 2010-08-04
Posts: 57

Simple Restful ORM Server with SQLite

Hi,

I would like to try out sample 28 - Simple Restful ORM Server, using SQLite.

I change the ODBC connection to :

  aProps := TODBCConnectionProperties.Create('',
    'Driver={SQLite3 ODBC Driver};Database=C:\Temp\REST.db3', '', '');

I also got an error on this line:

        // create tables or fields if missing
        aRestServer.CreateMissingTables;

 

so I commented it out, not sure why the error occurs.

Then server compiles and runs ok. When I run the client it looks like something is not working since the output is:

Added TPerson.ID=0
Name read for ID=0 from DB = ""

and nothing gets added to the database.

What needs to be changed to get the example to work?

Thanks
Rael

Offline

#2 2015-12-28 10:50:12

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,666
Website

Re: Simple Restful ORM Server with SQLite

Your odbc connection may be probably incorrect.
CreateMissingTables is mandatory, otherwise the tables are not created!

Offline

#3 2015-12-29 15:43:12

RaelB
Member
Registered: 2010-08-04
Posts: 57

Re: Simple Restful ORM Server with SQLite

Sorry, I updated the ODBC driver and then it worked fine.

-Rael

Offline

Board footer

Powered by FluxBB