Problems with importing SQLite3 with Exec in Gambas

New to Gambas? Post your questions here. No question is too silly or too simple.
Post Reply
User avatar
gambafeliz
Posts: 141
Joined: Friday 2nd September 2022 7:50pm
Location: I live in the same city as Picasso

Problems with importing SQLite3 with Exec in Gambas

Post by gambafeliz »

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.

      sSQL = ".import " & Application.Path & "/" & "file.dat table1" 
      mg.gConn.Exec(sSQL)
For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you. :)
User avatar
thatbruce
Posts: 168
Joined: Saturday 4th September 2021 11:29pm

Re: Problems with importing SQLite3 with Exec in Gambas

Post by thatbruce »

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
Have you ever noticed that software is never advertised using the adjective "spreadable".
User avatar
gambafeliz
Posts: 141
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

Post by gambafeliz »

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. :)
Post Reply