sSQL = ".import " & Application.Path & "/" & "file.dat table1"
mg.gConn.Exec(sSQL)
Problems with importing SQLite3 with Exec in Gambas
- gambafeliz
- Posts: 144
- Joined: Friday 2nd September 2022 7:50pm
- Location: I live in the same city as Picasso
Problems with importing SQLite3 with Exec in Gambas
I have a file with data that I want to add to an empty table. But when I use this statement on an already open database, it doesn't work. But when I do it from within in SQLite3 this same statement works perfectly fine. Give me some clue why it doesn't work. Indicate tells me that the (.) in front of import is the problem.
For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you.
Re: Problems with importing SQLite3 with Exec in Gambas
Thats because ".import" is an sqlite (the terminal front end) command, not an SQL verb. The gb.db.sqlite component works with the sqlite library, not the front end. You need to send the command to the front end via Shell or Exec.
b
b
- gambafeliz
- Posts: 144
- Joined: Friday 2nd September 2022 7:50pm
- Location: I live in the same city as Picasso
Re: Problems with importing SQLite3 with Exec in Gambas
Thank you very much, it will surely be like that.
For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you.