New topic: 

Syntax Error Somewhere :(

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

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        RicSum          Post subject: Syntax Error Somewhere :(Posted: 
Tue Mar 05, 2013 7:03 am                         
Joined: Fri Jun 05, 2009 4:54 pm
Posts: 428
Location: London, England                Hi,
Could someone please point out why the code below can not connect to the 
database correctly.

I keep getting the following error MsgBox: "Error reading or writing to the 
settings database!"

// Open and connect to database
Dim dbFile as FolderItem
Dim db as RealSQLdatabase
db=New RealSQLdatabase
dbFile = GetFolderItem("Support Files").child("Settings7.db")
db.DatabaseFile=dbFile
db.EncryptionKey = M_Global.E

If db.Connect() then
  
  // Clear the listbox and populate the listbox control
  Windowcc.ListBox1.deleteAllRows
  
  // run the query
  Dim sql as String
  Dim rs as RecordSet
  
  rs=db.sqlSelect(sql )
  
  if rs = NIL then
  Msgbox("Error reading or writing to the settings database!")
  exit sub
  end if
  
  while not rs.eof
  Windowcc.ListBox1.addRow ""
  for i as integer = 1 to rs.fieldCount
  Windowcc.ListBox1.cell(Windowcc.ListBox1.lastIndex, i-1) = 
rs.idxField(i).stringValue
  next
  rs.moveNext
  wend
  
else
  Beep
  MsgBox "Database Error!"
end if



I have a module called "M_Global.E" connected to the same window, with the 
following code:

dim keyVal as double = 24.
keyVal = keyVal * 10.^10. * 2.
keyVal = keyVal + 1726592673.
dim s as string = str( keyVal, "#" )
s = EncodeHex( MD5( s ) )
return s
      
_________________
RealStudio Professional Edition 2012 r2
Developing on OS X  10.8 (Mountain Lion)
Deploying on Windows XP / 7 / 8  
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
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