#1 2017-03-22 10:17:02

luscen
Member
Registered: 2014-04-21
Posts: 8

hi ab, Can i Use Database View's instead of Table?

My DB is MSSQL, the View Name is VXinXiShuLiang in the DB.
in server side:

    aProps := TSQLDBFireDACConnectionProperties.Create(DBServer, DBName, DBUser, DBPasswd);
    aProps.StoreVoidStringAsNull := False;

    CreateClassList();
    try
        aModel := TSQLModel.Create(SQLRecLassList, REST_ROOT);

        aModel.Props[TVXinXiShuLiang].NoCreateMissingTable := True;
        VirtualTableExternalMap(aModel, TVXinXiShuLiang, aProps, 'VXinXiShuLiang');

        VirtualTableExternalRegisterAll(aModel, aProps);
    except
        Exit;
    end;

in the client side:

    ent := TVXinXiShuLiang.CreateAndFillPrepare(aClient, whereStr);

the error log is :
    no such table
    extended_errcode=1

Offline

#2 2017-03-22 13:45:21

igors233
Member
Registered: 2012-09-10
Posts: 234

Re: hi ab, Can i Use Database View's instead of Table?

Offline

#3 2017-03-22 15:32:34

luscen
Member
Registered: 2014-04-21
Posts: 8

Re: hi ab, Can i Use Database View's instead of Table?

igors233 wrote:

think igors233, I have look the whole section: https://synopse.info/forum/viewtopic.php?id=3760.
but i can not solve my problem. the whole err log is :
Error SQLITE_ERROR(1)[SELECT ID,JiLuRQ,XinXiSL FROM VXinXiShuLiang] using 3.17.0 -no such table: VXinXiShuLiang,extended_errcode=1.

Offline

Board footer

Powered by FluxBB