Recent

Author Topic: TSQlite3Dataset.open returns "index out of bounds"  (Read 3812 times)

Caste1610

  • Newbie
  • Posts: 1
TSQlite3Dataset.open returns "index out of bounds"
« on: December 16, 2006, 03:33:18 pm »
Hello everybody,

I have just installed the SQLite package for Lazarus (btw. 0.9.20) and now I wanted to try it:
I created a TSqlite3Dataset in my app and called it SQL, I set filename and tablename as said in the wiki to my databasse and wanted to create a table by right-click and "Create Table".
This fails each time I try and I erased all information in the properties window and made my program do the initialisation:
Code: [Select]
SQL := TSQLite3Dataset.Create(nil);
SQL.FileName := '/home/tbcm/ausleihen.db';
SQL.SQL := 'create table table(index INTEGER PRIMARY_KEY NOT NULL,von VARCHAR(50),an VARCHAR(50),was VARCHAR(200),datum DATE)';
SQL.TableName:='table';
SQL.SaveOnClose:=true;
SQL.Open;

But when I want to run, the program aborts and tells me the index (-1) is out of bounds...

The file was created, but is still empty.. How can I make my app create the table?

LuizAmérico

  • Sr. Member
  • ****
  • Posts: 457
RE: TSQlite3Dataset.open returns "index out of bounds&q
« Reply #1 on: December 28, 2006, 06:07:27 pm »
Instead of SQL.Open do SQL.EXECSQL

 

TinyPortal © 2005-2018