New topic: 

Error Message

<http://forums.realsoftware.com/viewtopic.php?t=46969>

         Page 1 of 1
   [ 8 posts ]                 Previous topic | Next topic          Author  
Message        Tegwin          Post subject: Error MessagePosted: Sat Feb 16, 
2013 10:12 am                         
Joined: Fri Nov 18, 2005 7:26 pm
Posts: 15                I am very new to RS and programming. I am working on 
the tutorials by Paul Lefebvre on VTC.  I have asked him many questions when I 
have gone wrong so I figured I am out of questions with him and wondered if 
someone on this forum can help me


I have the error "Paramaters not compatible with this function'
ToDoDB.SQLExecute(TodoSchemaSQL)

The code for this I think is as below
  ToDoDB = New REALSQLDatabase //SQLite
  
  
  Dim dbFile as FolderItem
  Dim dbFolder as FolderItem
  dbFolder = SpecialFolder.ApplicationData.Child(App.kAppName)
  
  if Not dbFolder.Exists Then
  dbFolder.CreateAsFolder
  End if
  
  dbFile = dbFolder.Child(kDatabaseFilename)
  
  ToDoDB.DatabaseFile = dbFile
  
  Dim connect As  Boolean
  if  dbFile.Exists  Then
  connect = TodoDB.Connect
  Else
  //Create the database
  connect = toDoDB.CreateDatabaseFile
  
  if connect Then 
  //Create the DB Schema
  connect = CreateDatabaseSchema
  End if
  end if
  
  Return connect

Any idea why I am getting this error message   
                             Top                DaveS          Post subject: 
Re: Error MessagePosted: Sat Feb 16, 2013 11:07 am                              
   
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4562
Location: San Diego, CA                Quote: have the error "Paramaters not 
compatible with this function'
ToDoDB.SQLExecute(TodoSchemaSQL)


First question you need to ask is..

What KIND of parameter does SQLExecute Accept..... the ANSWER is a string

The Second question you need to ask is.

What type of variable is "ToDoSchemaSQL".... your example DID NOT say... so I 
am assuming it is NOT a string.      
_________________
Dave Sisemore
MacPro, OSX Lion 10.7.4 RB2012r1
Note : I am not  interested in any solutions that involve custom Plug-ins of 
any kind  
                             Top                Tegwin          Post subject: 
Re: Error MessagePosted: Sat Feb 16, 2013 12:18 pm                         
Joined: Fri Nov 18, 2005 7:26 pm
Posts: 15                Ok I managed to get this to work. 

Thanks for the help   
                             Top                DaveS          Post subject: 
Re: Error MessagePosted: Sat Feb 16, 2013 12:30 pm                              
   
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4562
Location: San Diego, CA                common practice it to post what you 
found and how your fixed it.. so others can learn from your mistakes.      
_________________
Dave Sisemore
MacPro, OSX Lion 10.7.4 RB2012r1
Note : I am not  interested in any solutions that involve custom Plug-ins of 
any kind  
                             Top                Tegwin          Post subject: 
Re: Error MessagePosted: Sat Feb 16, 2013 2:54 pm                         
Joined: Fri Nov 18, 2005 7:26 pm
Posts: 15                DaveS wrote:common practice it to post what you found 
and how your fixed it.. so others can learn from your mistakes.

Oops Sorry!!! Will remember for next time.  I get a lot of help from here, so 
only fare I give back. 


 Basically I had dragged a SQL file into the project with the SQL Statement in. 
 For some reason though it was seeing it as a database rather than the actual 
file with the Statement in it.. (i.e when I clicked on the file it opened 
REALSQLDatabase)  So all I did was delete the file and re inserted it and it 
seemed to work.   
                             Top                Tegwin          Post subject: 
Re: Error MessagePosted: Sat Feb 16, 2013 2:59 pm                         
Joined: Fri Nov 18, 2005 7:26 pm
Posts: 15                I actually have another problem with this, which I 
cannot figure out . i  have made sure its right, from the code on the video. I 
have checked and rechecked but still does not work. 

I am getting an error An Exception of Class OutofBoundsException was not 
handled. The application must shut down. 

I get it when I run the following code. 

  TaskList.DeleteAllRows
  
  
  Dim allTasks() as Task
  allTasks = Task.GetAll
  
  Dim row as Integer
  For Each t As Task In allTasks
  TaskList.AddRow("")
  
  
  row = Tasklist.ListIndex
  
  TaskList.CellCheck(row,0)  =  t.Completed
  TaskList.Cell(row, 1) = t.Name
  
  taskList.Cell(row, 3) = Str(t.Priority)
  tasklist.Cell(row,4) = t.Category
  
  TaskList.RowTag(row) = t  // Save References so we can reference them later
  
  Next
  



I have a shared Method called "GetAll" which returns Task()

Function GetAll() as Task()


  Dim allTasks() As Task
  
  Dim sql as String
  sql  = "Select ID FROM Task Order by NAME"
  
  Dim Results as RecordSet
  results = ToDoDB.SQLSelect(sql)
  
  if results <> Nil then
  Dim t as Task
  While Not results.EOF
   t = New Task(Results.Field("ID").IntegerValue)
  
  allTasks.Append(t)
  results.MoveNext
  Wend
  results.close
  end if
  
  Return allTasks

I think it is happening somewhere around there. 

Any ideas ?   
                             Top                DaveS          Post subject: 
Re: Error MessagePosted: Sat Feb 16, 2013 3:12 pm                               
  
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4562
Location: San Diego, CA                row = Tasklist.ListIndex

should probably be 

row = Tasklist.LASTIndex

ListIndex is currently selected row.... defaults to -1 after a DELETEALLROWS

LASTIndex is the index of the last row added      
_________________
Dave Sisemore
MacPro, OSX Lion 10.7.4 RB2012r1
Note : I am not  interested in any solutions that involve custom Plug-ins of 
any kind  
                             Top                Tegwin          Post subject: 
Re: Error MessagePosted: Sat Feb 16, 2013 6:01 pm                         
Joined: Fri Nov 18, 2005 7:26 pm
Posts: 15                Thank you Dave. I was looking for ages and could not 
find it. I thought I had seen that . 

Note to self.. Look more closely before posting    
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 8 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to