Bart,


Not possible in my case, as I create this simple DB with Marco's app (SQLiteManager in demo mode). When the Table has disapeared, I re-create it using SQL in SQLiteManager.

I don't handle any creation/alteration of the structure of the BD inside my code. I don't use bindings, nor any RB controls (DataControl, DatabaseQuery). No fancy SQL (just SELECT so far...).

For instance, I import records from a text file (.csv) with the following Method :


  select case engine

  case KengineRDB
    Dim f, ff as FolderItem
    Dim textInput As TextInputStream
    Dim rowFromFile,oneCell As String
    Dim i, nbrechamps As Integer

    f = getfolderitem(app.NomBase)
    ff = GetOpenFolderItem("")  //defined as a FileType


    If ff <> Nil Then

      if DB_Connect(KengineRDB, f) then

        textInput = ff.OpenAsTextFile
        textInput.Encoding= Encodings.MacRoman //strings are MacRoman
        nbrechamps = CountFields(rowFromFile,",")

        dim rec as New DatabaseRecord

        Do
          rowFromFile = textInput.ReadLine

rec.IntegerColumn("ID_Patient") = DB_autoincrement(KengineRdb,"PATIENTS_TBL","ID_Patient")
          rec.Column("Genre") = NthField(rowFromFile, ",",2)
          rec.Column("Nom") = NthField(rowFromFile, ",",3)
          rec.Column("Prenom") = NthField(rowFromFile, ",",4)
          rec.Column("No_SS") = NthField(rowFromFile, ",",5)

          if DB_insertRecord (KengineRDB,rec, "PATIENTS_TBL") then

            MyRDB.Commit

            // All is OK
          else
            MsgBox "Erreur à l'insertion"
          end if

        Loop Until textInput.EOF
        textInput.Close

      else
        // Pas de connection à la Base de Données
      end if
    End If

  case KengineRDBServer

  Case KengineValentina

  Case KengineValentinaServer

  Case KengineMySQL

  Case KenginePGSQL

  end






Youri








Bart Pietercil wrote:

On 12-dec-06, at 21:57, Youri wrote:



Maybe you are inserting your table and their data inside a transaction and then instead of "commit" you "rollback"...

Can you please explain what you mean?

Marco means that it is possible to
1) start a transaction (look for "begin transaction" or "begin work")
2) create the table
3) fill it with data

then quit

Since I omitted the necessary "commit" step sqlite will cancel (rollback) everything you did until the start of the transaction.


Another possibility would be that you create the table as a temporary table. Look at the create code for the db



Would this Delete my Table?

yes



or there is an error
somewhere executing an sql command that you are ignoring...


Nop. I have been looking for all sql command and nothing that could delete the Table.


Cheers,

HTH

Bart Pietercil
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to