Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 5 of 5
  1. #1
    Join Date
    May 2003
    Location
    Belarus
    Posts
    45

    Help to get error in SQLite searching

    This function is for word searching in SQLite database. I cannot get error message. I need to write "Word was not find" when it will be an error during sqlite searching. HELP ME PLEASE.



    tWords_Selected = SQLite.QueryToTable (db, "Select * from Words Where Label='"..input_result.."'");
    if tWords_Selected.Data[1]["Label"] ~= nil then
    word_id = tWords_Selected.Data[1]["RecordID"];
    word_label = tWords_Selected.Data[1]["Label"];
    word_text = tWords_Selected.Data[1]["Text"];
    word_sound = tWords_Selected.Data[1]["Sound"];
    speak_word();
    Paragraph.SetText("label", word_label);
    Paragraph.SetText("text", word_text);

    if word_id == 1 then
    Button.SetVisible("ButtonLeft", false);
    Button.SetVisible("ButtonRight", true);
    end
    if word_id == word_id_max then
    Button.SetVisible("ButtonLeft", true);
    Button.SetVisible("ButtonRight", false);
    end
    end

  2. #2
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    Code:
    tWords_Selected = SQLite.QueryToTable (db, "Select * from Words Where Label='"..input_result.."'");
    if tWords_Selected.Data[1]["Label"] ~= nil then
    	word_id = tWords_Selected.Data[1]["RecordID"];
    	word_label = tWords_Selected.Data[1]["Label"];
    	word_text = tWords_Selected.Data[1]["Text"];
    	word_sound = tWords_Selected.Data[1]["Sound"];
    	speak_word(); 
    	Paragraph.SetText("label", word_label);
    	Paragraph.SetText("text", word_text);
    
    	if word_id == 1 then
    		Button.SetVisible("ButtonLeft", false);
    		Button.SetVisible("ButtonRight", true); 
    	end
    	if word_id == word_id_max then
    		Button.SetVisible("ButtonLeft", true);
    		Button.SetVisible("ButtonRight", false); 
    	end
    else
    	--display your message here
    end

  3. #3
    Join Date
    May 2003
    Location
    Belarus
    Posts
    45

    it does not work

    I did it, but it writes next message:


    Error
    On Key, Line 47: attempt to index field '?' (a nil value)

    Need some more help :(:(:(

  4. #4
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    Code:
    tWords_Selected = SQLite.QueryToTable (db, "Select * from Words Where Label='"..input_result.."'");
    if tWords_Selected.Rows > 0 then
    	word_id = tWords_Selected.Data[1]["RecordID"];
    	word_label = tWords_Selected.Data[1]["Label"];
    	word_text = tWords_Selected.Data[1]["Text"];
    	word_sound = tWords_Selected.Data[1]["Sound"];
    	speak_word(); 
    	Paragraph.SetText("label", word_label);
    	Paragraph.SetText("text", word_text);
    
    	if word_id == 1 then
    		Button.SetVisible("ButtonLeft", false);
    		Button.SetVisible("ButtonRight", true); 
    	end
    	if word_id == word_id_max then
    		Button.SetVisible("ButtonLeft", true);
    		Button.SetVisible("ButtonRight", false); 
    	end
    else
    	--display your message here
    end

  5. #5
    Join Date
    May 2003
    Location
    Belarus
    Posts
    45

    BIGBIGBIG THNX - topic is closed

    BIGBIGBIG THNX - topic is closed
    BIG THANX. Everything is working. Topic can be closed.

Similar Threads

  1. SQLite plugin problem
    By swilk in forum AutoPlay Media Studio 5.0
    Replies: 3
    Last Post: 11-10-2009, 05:22 PM
  2. How to convert access database to sqlite database.
    By sside in forum AutoPlay Media Studio 5.0
    Replies: 2
    Last Post: 07-22-2008, 07:44 PM
  3. SQLite Command Question (DELETE ROW)...
    By Intrigued in forum AutoPlay Media Studio 5.0
    Replies: 15
    Last Post: 12-08-2006, 11:17 AM
  4. SQLite data to HTML file
    By Intrigued in forum AutoPlay Media Studio 5.0
    Replies: 16
    Last Post: 10-23-2004, 03:19 AM
  5. Spotlight: SQLite Actions Plugin
    By Desmond in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 03-12-2004, 09:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts