Sign in to follow this  
Followers 0
milos83

_SQLite like ini

2 posts in this topic

#1 ·  Posted (edited)

Hi guys!

Recently I start using _SQLite and I dont know much about sql databases.So I am complete noob...dont flame me for the Q :D

I used ini like a database. My log was written in a INI file, but problem is that when INI get larger, IniWrite become too slow.

Is there a way to code _SQLite to work like INI files...

i manage to create the database, write, read from it...

so i have:

_SQLite_Exec($dbn, "CREATE TABLE datas (section1,text);")

How to create keys and values under that section1?

And offcourse how to retrive it.

I tryed SQLite tutorials but no help there for me :o

Much thanx in advance

Edited by milos83

Share this post


Link to post
Share on other sites



Hi guys!

Recently I start using _SQLite and I dont know much about sql databases.So I am complete noob...dont flame me for the Q :o

I used ini like a database. My log was written in a INI file, but problem is that when INI get larger, IniWrite become too slow.

Is there a way to code _SQLite to work like INI files...

i manage to create the database, write, read from it...

so i have:

_SQLite_Exec($dbn, "CREATE TABLE datas (section1,text);")

How to create keys and values under that section1?

And offcourse how to retrive it.

I tryed SQLite tutorials but no help there for me :D

Much thanx in advance

I would create one log.dat file, create a separate table for each "section", then have at least two fields for the entries, i.e. "TimeStamp" and "Text". So you would have something like:
_SQLite_Exec($dbn, "CREATE TABLE Section1 (Index PRIMARY,TimeStamp TEXT,Entry TEXT);")
_SQLite_Exec($dbn, "CREATE TABLE Section2 (Index PRIMARY,TimeStamp TEXT,Entry TEXT);")
_SQLite_Exec($dbn, "CREATE TABLE Section3 (Index PRIMARY,TimeStamp TEXT,Entry TEXT);")

; Add entry to section 2
_SQLite_Exec($dbn, "Insert INTO Section2 (TimeStamp,Entry) VALUES (" & _NowCalc() & ",'This is my entry, with text.');")

The Index field gives you an automatic integer index for every entry, and the TimeStamp and Entry fields give you the standard log entry info.

Play with the example scripts in the help file for the various _SQLite* functions.

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0