New topic: 

error after db.commit

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

       Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic         Author  
Message       suibaf           Post subject: error after db.commitPosted: Tue 
Dec 08, 2009 4:45 am                               
Joined: Tue Dec 16, 2008 9:08 am
Posts: 160
Location: Lecce (Italy)              Please look this little piece of 
code:Code:'Vengono istanziati gli oggetti Connection e Recordset

Dim rsParam As Recordset
Dim db as REALSQLdatabase
db=New REALSQLdatabase
Dim i as integer

db.DatabaseFile=dbConfig

If db.Connect() then
  
  rsParam = db.SQLSelect( "SELECT * FROM TAG_INQ ORDER BY ind_inq" )
  
  if db.Error then
  //handle error
  
  MsgBox "Errore durante la lettura del Database di configurazione"
  
  end if
  
  if rsParam.BOF = True and rsParam.EOF = True then
  
  MsgBox "database Empty"
  rsParam.Close
  db.Close
  Return
  
  end if
  
  rsParam.Edit
  
  if left(Wscript.Title,9) = "Script TQ" then
  
  for i = 1 to num_inq
  
  if i = posiz_inq then
    
    rsParam.Field("script_tq").StringValue = campo_script.Text // aggiorno il 
campo_script
    tag_inq(posiz_inq).script_tq = campo_script.Text// aggoirno anche la 
variabile globale
    
  end if
  
  rsParam.MoveNext
  
  next
  
  else
  
  for i = 1 to num_inq
  
  if i = posiz_inq then
    
    rsParam.Field("script_nr").StringValue = campo_script.Text  // aggiorno il 
campo_script
    tag_inq(posiz_inq).script_nr = campo_script.Text // aggoirno anche la 
variabile globale
    
  end if
  
  rsParam.MoveNext
  
  next
  
  end if
  
  rsParam.Update
  db.Commit
  rsParam.Close
  
  if db.Error then
  //handle error
  
  MsgBox "Errore durante la scrittura sul DB di configurazione: " + 
Str(db.ErrorCode) + EndOfLine + _
  EndOfLine + db.ErrorMessage
  
  end if
  
else
  Beep
  MsgBox "Database Error: " + Str(db.ErrorCode) + EndOfLine + _
  EndOfLine + db.ErrorMessage
end if

'chiudo la connessione al database
db.Close




It goes in error after commit with    Code:MsgBox "Errore durante la scrittura 
sul DB di configurazione: " + Str(db.ErrorCode) + EndOfLine + _
  EndOfLine + db.ErrorMessage

DB error is: "cannot commit -transaction is not active". What does it mean? 
Have i forget something?

Regards

Fabio     
_________________
RB2009R4
My native language is Italian, I'll try to make my posts understandable for 
everybody.  
                            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