• Welcome, Guest. Please login.
 
August 15, 2020, 10:45:53 am

News:

Welcome to the SQLitening support forums!


Adding Table to Existing db

Started by Marty Francom, January 23, 2014, 10:37:15 pm

Previous topic - Next topic

Marty Francom

How do I add a new tablet to an existing SQLite database ?

I want to first check if the table exists in the database and then add it if it
does not exist.

Jean-Pierre LEROY

Hi Marty,

Let say you want to add a table "Params" if this table doesn't exist yet:


lSql = "CREATE TABLE IF NOT EXISTS Params (" +_
           "Key   TEXT, "                        +_
           "Value TEXT) "                     
    lResult = slExe(lSql)
    If lResult Then
        MessageBox(%HWND_DESKTOP," slExe:"+slGetError+":"+lSql+$CrLf, "", %MB_OK Or %MB_DEFBUTTON1 Or %MB_ICONERROR Or %MB_TASKMODAL)
    End If

Marty Francom

Thanks, Jean_Pierre, that's what I needed to know.