Changes between Version 13 and Version 14 of Docs/Prog/Manual/ApplicationLibraries/lib825db


Ignore:
Timestamp:
10/23/25 07:42:23 (3 weeks ago)
Author:
Don Wilson
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Docs/Prog/Manual/ApplicationLibraries/lib825db

    v13 v14  
    5252}
    5353}}}
     54This instantiates either a CDBMySQL object for MySQL or a CDBSQLite. The CDB* pointer appDB is assigned to the created object.
    5455
    5556Existing apps with have sql execute statements such as:
     
    6768}}}
    6869To support both SQLite and MySQL the brackets must be removed from table and field names in SQL statements.
     70
     71Existing apps may have code such as:
     72{{{
     73string sql = "INSERT INTO [Trucks] ([ID],[TareWt]) VALUES ('" + truckID +"'," + IntToStr(tare) + ");";
     74if (rc_is_okay(db.execute(sql)) == false) {
     75   DrawErrorBox("Cannot insert record", 4);
     76}
     77}}}
     78Replace with:
     79{{{
     80string sql = "INSERT INTO Trucks (ID,TareWt) VALUES ('" + truckID +"'," + IntToStr(tare) + ");";
     81if (appDB->execute(sql) == false) {
     82   DrawErrorBox("Cannot insert record", 4);
     83}
     84}}}
    6985
    7086Existing apps will have code such as: