Problem Converting CSV to SQLite

Discussion in 'Questions (Windows Mobile)' started by tcgoh, Oct 31, 2007.

  1. tcgoh

    tcgoh Active Member Licensed User

    Hi Erel,

    I’m very new to SQL programming. I have used dzt’s program under ”Convert Any Database to SQLite(source & exe) to convert my CSV file to SQLite(.sl3) file.

    After converting to SQLite file (test.sl3), its look very difference from your northwind.sl3 file.

    Attached is my CUSTS2.CSV file. Can you help or any suggestions on ways to convert files?

    Thanks
    TC
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You can use Connection.CreateSQLTable to convert your CSV file.
    Using a Table control load the file with Table.LoadCSV.
    Now export the table data to a SQL table using Connection.CreateSQLTable.
    There is a small example here: http://www.basic4ppc.com/help/sql/index.html
     
  3. tcgoh

    tcgoh Active Member Licensed User

    Tks Erel,
    I used dzt's example and my sl3 file come up very difference. please see attached. Not sure I got is right?
    Thanks.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    This is not a valid SQLite database.
    I recommend you to use Connection.CreateSQLTable.
     
  5. dzt

    dzt Active Member Licensed User

    Hi,

    I've tested your CSV with my example and it produces a valid SQlite database.

    My example uses mainly Connection.CreateSQLTable, plus the VB6 program to produce the CSVs from databases
     
  6. tcgoh

    tcgoh Active Member Licensed User

    Hi dtz,

    Thank you for looking into my problem. Could you kindly give me an example (or codes) on how to use Connection.CreateSQLTable and export to .sl3 file.

    Many thanks
    TC
     
Loading...