Error proyect Sqlite

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

claudiotedesco
Posts: 132
Joined: Thu Jul 31, 2008 12:05 pm

Re: Error proyect Sqlite

Post by claudiotedesco »

Hola rathinagiri

te queria consultar por el siguiente error
Date:12/07/2010 Time: 11:53:37
Error BASE/4001 Argument error: SQLITE3_EXEC


Called from SQLITE3_EXEC(0)
Called from MISCSQL(78)
Called from CREARBASE(28)
Called from MAIN_BUTTON_1_ACTION(12)
Called from (b)MAIN(11)
Called from _DOCONTROLEVENTPROCEDURE(5262)
Called from EVENTS(1434)
Called from _DOMESSAGELOOP(0)
Called from _ACTIVATEWINDOW(4853)
Called from DOMETHOD(7367)
Called from MAIN(10)


Este error es cuendo quiero crear la Base y la table desde cero.
La base se tiene que llamar nombre.db3 y la table personales
Adjunto los archivos
Gracias
Attachments
sqlite.rar
(41.95 KiB) Downloaded 461 times
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Error proyect Sqlite

Post by Rathinagiri »

Hi Claudio,

Your crearbase function should be like this...

miscsql always require two parameters. First one is dbo object and the next one is the query. When creating a database, we have to use connect2db with .t. as the second parameter. I hope this helps.

Code: Select all

function crearbase(mDb)
  local sQry
  local lOk := .f.
  sQry := "CREATE TABLE IF NOT EXISTS personales (id INTEGER PRIMARY KEY, nombre VARCHAR(55), telefono VARCHAR(15), fecha  DATE);"  
  dbo := connect2db(mDb, .t.)
  lOk := miscsql(dbo,sQry)
return nil  
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Error proyect Sqlite

Post by mustafa »

Hola claudiotedesco y Rathi
Estoy siguiendo con mucho interes este proyecto tuyo,pues desconozco por
completo este sistema de base de datos.
Una pregunta:
Se pueden crear campos: Lógico, Fecha, Memo ?
Tambien se pueden indexar las bases Sqlite ?
Como se hace para efectuar una Busqueda de campos
Si no es molestia, me gustaria que ampliaras tu ejemplo si es posible ya que para mi
muy interesante, sobre todo la Busqueda de datos me gustaria saber como se hace.
Gracias
*-----------------------Google ---------------------*
Hello claudiotedesco and Rathi
I am following with great interest this project of yours, then unknown to me
This comprehensive database system.
One question:
You can create fields: Logical, Date, Memo?
Also, the bases are indexed Sqlite?
How does one make a search field
If you do not mind, I would like to extend your example if possible and for me
very interesting, especially the search data I would like to know how.
Thanks
Mustafa
claudiotedesco
Posts: 132
Joined: Thu Jul 31, 2008 12:05 pm

Re: Error proyect Sqlite

Post by claudiotedesco »

Hola Rathi
Gracias por tu ayuda, funciono perfecto el arreglo.

Hola Mustafa
Te comento que yo estoy experimentando Sqlite y me parece muy interesante este tipo de base de datos.
Este proyecto que estoy armando, gracias a Rathi, me sirve para estudiar Sqlite y HMG.
Hasta ahora pude crear la Base con tabla y hacer altas, bajas y modificaciones, el segundo paso es hacer consultas que no es complejo sino que sabiendo SQL salen muy bien.
Con respecto a los indices si se pueden crear, aún no experimente campos memos ni logicos!!!!
Creo que Rathi sabra mas que yo si se puede?
Cualquier novedad te aviso.
Gracias y saludos
Claudio
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Error proyect Sqlite

Post by Rathinagiri »

Yes. We can have logical values too. We have to define the field as "BOOL" (short for boolean).

Other types of fields includes,

Integer, Bool, Real, Double, Float, Char, Text, VarChar, Blob, Numeric, Date, Time.

SQLite is not a strict field type emphasizing database. It accepts anything in any field as character strings. However, it would be better to store the respective fields with respective types of values.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Error proyect Sqlite

Post by mustafa »

Hola Claudio
Yo estos muy retrasado con Sqlite , pero veo
que el tema es muy interesante , yo estoy siguiendo con tu
aplicacion la enseñanza, es por esto que si añades algo nuevo
lo integres en tu ejemplo, para no perder el hilo.

Gracias Rathi por tu inestimables enseñanzas
Muchas Gracias por compartir

*---------------- Google -------------------*
Hello Claudio
I these very late with Sqlite but I see
the subject is very interesting, I'm getting on with your
teaching application, which is why if you add something new
integrate it into your example, not to lose the thread.

Rathi Thanks for your invaluable lessons
Thank you very much for sharing

Mustafa
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Error proyect Sqlite

Post by mustafa »

Hello friends :
I want to introduce a humble working with Sqlite database that one day began the
Sudip friends , Rathinagiri , Amarante , Fouednoomen , Qatan , Claudiotedesco
I have based example Claudiotedesco initiated .

I present a data base where we can make New , Change, Delete
Do Search by Code or by Name and according to the Search
We can draw two Listings one ordered by Code or Name
The idea ,is that the user can see all sides of a Database
complement is also the option of placing a Photo.

New: Password which is encrypted in a memo field
admin admin is the Key , if you forget the key to delete the file 'xControl.mem'
a new password will be generated with admin, admin
In a backup folder backup_files ' Zip_Seg.Zip ' will be done with the database
and another file ' Zip_Seg.md5 ' with a code so 7f75d8c703158f135806882e6e9b6064
when you start the application compares if the Zip_Seg.Zip has been tampered with
or missing some file .

I pray consult all entries that accompany them, so if you want to experience
with the true masters of SQlite

viewtopic.php?f=6&t=1558" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;
viewtopic.php?f=15&t=853" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;
viewtopic.php?f=10&t=2112" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;
viewtopic.php?f=12&t=3430&p=31524#p31524" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;
viewtopic.php?f=5&t=2951" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;
viewtopic.php?f=37&t=2275&p=32226#p32226" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;

regards
Mustafa
Attachments
Sample_Sqlite.zip
(1.75 MiB) Downloaded 565 times
Help_Fondo.jpg
Help_Fondo.jpg (173.18 KiB) Viewed 7112 times
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Error proyect Sqlite

Post by esgici »

Hola Mustafa

Thank you sharing your work :arrow:

Viva HMG :D
Viva INTERNATIONAL HMG :D
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Error proyect Sqlite

Post by Rathinagiri »

Looks very nice.

How do you store the pictures?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Error proyect Sqlite

Post by mustafa »

Hola Maestro Rathinagiri
Mire por Favor el Fichero Main_SQlite.Prg
Para New en
*----------------------------------*
Function vnombre_baceptar_action()
*----------------------------------*
entramos el valor de Win_1.text_5.value en
c2sql("Photo\"+Win_1.text_5.value+".jpg")+")")
y en Grid ONCHANGE vnombre_grid_1_onchange()
*-------------------------------------------*
Function vnombre_grid_1_onchange()
*-------------------------------------------*
Win_1.ImagePhoto.Picture := ("Photo\"+ SUBSTR( aline[7],7,5)+".jpg")
a lo mejor no es muy correcto, pero asi veo que funciona
un saludo
Mustafa

*-----------------------------------------------------------------*
Hello Master Rathinagiri
Please look for the file Main_SQlite.Prg
For New in:
* ---------------------------------- *
Function vnombre_baceptar_action()
* ---------------------------------- *

enter the value in Win_1.text_5.value

c2sql("Photo\"+Win_1.text_5.value+".jpg")+")")

Grid and ONCHANGE vnombre_grid_1_onchange ()

* ------------------------------------------- *
Function Vnombre_grid_1_onchange()
* ------------------------------------------- *
Win_1.ImagePhoto.Picture: = ("Photo \" + SUBSTR (aline [7], 7,5) + "jpg.")

maybe it is not quite correct, but I see that it works well

a greeting
Mustafa
Post Reply