New topic: Adding to DB using DatabaseRecord
<http://forums.realsoftware.com/viewtopic.php?t=38032> Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message tudorH Post subject: Adding to DB using DatabaseRecordPosted: Thu Mar 10, 2011 12:51 am Joined: Thu Feb 03, 2011 5:44 pm Posts: 18 Hi guys, so I am trying to add a record to a table using the DatabaseRecord type but I am having some issues. The record is successfully added to my table but its blank...I can click on the record but there is no data (ie: no contact id = test etc.). Below is a part of my code and everytime I run it I get the "Record Successfully Added" MsgBox so I'm unsure why the record does not have the data specified...Any ideas? Code: rec.Column("ContactID") = "test" rec.Column("DataownerID") = "test" rec.Column("UserName") = "john" db.InsertRecord("testtable", rec) If (db.Error= False) then db.commit If db.error = False then MsgBox "Record successfully added!" Else MsgBox "Record NOT added!" End if else db.RollBack If db.Error=False then MsgBox "Record could not be added but was rolled back." Else MsgBox "Record could not be added nor save rolled back." End if End if db.close Thanks in advance for any help :):) 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]
