Not a string?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • ChatNoir
    Indigo Rose Customer
    • Mar 2005
    • 9

    Not a string?

    Any chance of somebody telling me what I'm doing wrong here.

    Code:
    function SaveForm()
    	local iValidity
    	local tValidity
    	local sData
    	local sPath
    	
    	iValidity = 0;
    	tValidity = ListBox.GetSelected("lbxFormValidity");
    	for index, item in tValidity do
    		iValidity = iValidity + ListBox.GetItemData("lbxFormValidity", index);
    	end
    	sPath = Input.GetText("inFormPath");
    	sData = Crypto.Base64EncodeToString(sPath);
    	sSQl = "INSERT IGNORE INTO forms VALUES(NULL, '"..Input.GetText("inFormVersion").."', '"..Input.GetText("inFormName").."', '"..iValidity.."', '"..Input.GetText("inFormFileName").."', '"..ComboBox.GetText("cbxFormType").."', '"..ComboBox.GetText("cbxFormFormat").."', '"..Input.GetText("inFormDescription").."' ,'"..sData.."')";
    	Paragraph.SetText("Paragraph1", sSQL);
    	SQLite.Query(db, sSQL);
    	Error_Check();
    end
    Brings up the message that the sSQL variable for the following commands is not a string.

    Code:
    	Paragraph.SetText("Paragraph1", sSQL);
    	SQLite.Query(db, sSQL);
    However if I switch the sSQL for those two lines with

    Code:
    "INSERT IGNORE INTO forms VALUES(NULL, '"..Input.GetText("inFormVersion").."', '"..Input.GetText("inFormName").."', '"..iValidity.."', '"..Input.GetText("inFormFileName").."', '"..ComboBox.GetText("cbxFormType").."', '"..ComboBox.GetText("cbxFormFormat").."', '"..Input.GetText("inFormDescription").."' ,'"..sData.."')"
    it works fine.

    Obviously I can just create the sql statement in the sqlite command, but I don't see why it doesn't work the other way.

    Cheers
  • csd214
    Forum Member
    • Oct 2001
    • 939

    #2
    Doesn't you have a lower-case "L" in
    sSQl = "INSERT IGNORE INTO forms VALUES(NULL, '"..

    Try upper-case "L" like sSQL = …..

    Comment

    • ChatNoir
      Indigo Rose Customer
      • Mar 2005
      • 9

      #3
      Oh dear, I think I've been staring at this too long. Oh for Option Explicit!

      Comment

      Working...
      X