Jump to content

Sqlite3 Ile Açtığım Tabloları Yazdıramıyorum


turkoglu98
 Share

Recommended Posts

arkadaşlar araştırdım bir kod buldum ama yazdıramıyorum
kod bu
[quote name='galetis' date='04 January 2012 - 00:02 ' timestamp='1325628156' post='1135477']

Varolan tabloların isimlerini alma;
[code]SELECT * FROM dbname.sqlite_master WHERE type='table';
[/code]
[/quote]

soru şu
sqlite3 veritabanında açtığım tabloları nasıl yazdırabilirim
--tüm tabloları almaktan listboxa yazdırmaya kadar kod lazım

[size="5"][color="#FF0000"]YARDIMCI OLABİLECEK ARKADAŞLARA ŞİMDİDEN TEŞŞEKKÜRLER [/color][/size]
Link to comment
Share on other sites

  • Editor

bu şekilde yaparsın

SQLite3Cursor, err = SQLite3Connection:execute("SELECT * FROM database");
oku = SQLite3Cursor:fetch({},"a");

while oku do
ListBox.AddItem("ListBox1",oku.sütunadı, "");
oku = SQLite3Cursor:fetch(oku,"a");
end

Link to comment
Share on other sites

arkadaşım anlamadın sen beni ben :
----------------------------------
SQLite3Cursor, err = SQLite3Connection:execute("SELECT * FROM database");
----------------------------------
burada database yazdığın yer tablo olması gerekiyor bende
bir .db uzantılı dosya var onun için de bunun gibi 6 tane var ama bu altı tanesini yazdıramıyorum

-----------------------------------------------------------------------------------------------------
bir program yapıcam (veresiye programı sakın bana böyle bir çalışma var demeyin)
her kişi için ayrı tablo açmam gerekiyor bu tablonun içindede id,borç,açıklama,tarih gibi şeyler olucak
böylece karışıklık olmuyacak

http://pclad.com/a.bmp

Edited by turkoglu98
Link to comment
Share on other sites

  • Editor

SQLite3Connection, err = SQLite3:connect("database");-- bu komutla database e bağlandık
SQLite3Cursor, err = SQLite3Connection:execute("SELECT * FROM tabloadı");--burada ise hangi tablodan değer alacaksak o tablo adını yazıyoruz.
oku = SQLite3Cursor:fetch({},"a");

bu kod sana göre işte ama kullanmasını bilirsen.

her bir tablo için bunu fonksiyon haline getir.

Link to comment
Share on other sites

  • Editor

istediğin şeyi araştırdım ve şuna karar verdim Database kısmındaki sqlite3 plugini değilde actions olarak alınan Sqlite plugini daha iyiymiş onu öğrendim.

ve istediğin sonucuda buldum.

[code]
db = SQLite.Open("C:\\deneme.db");

tResult = SQLite.QueryToTable(db, "SELECT * FROM sqlite_master WHERE type='table'")
for i, k in pairs(tResult.Data) do
Dialog.Message("Result!", tResult.Data[i]["name"]);
end[/code]

Tablo oluşturmak için :

[code]--SQLite.Query(db,"create table foo(a integer primary key, b text, c integer)");
--SQLite.Query(db,"create table bar(a integer primary key, b text, c integer)");[/code]

Link to comment
Share on other sites

  • Editor

Valla sqlite3 desteği varmı bilmiyorum ama normal veritabanı felan oluşturduktan sonra navicat veri eklemene izin veriyor muhtemelen sqlite3 dür.Tablo isimlerini alabildinmi.

Link to comment
Share on other sites

  • Editor

Navicat ile yaptıgın database i sqlite plugini okumuyor malesef o yüzden sqlite programı ile

[code]SQLite.Query(db,"create table senintablo(a integer primary key, b text, c integer)");[/code]

bu kodu kullanarak tablo içinde kolonlar oluşturabilirsin.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...