New topic: 

InsertRecord not failing, but not creating record either

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

       Page 1 of 1
   [ 2 posts ]                 Previous topic | Next topic         Author  
Message       stevepugh           Post subject: InsertRecord not failing, but 
not creating record eitherPosted: Fri Dec 04, 2009 7:38 pm                      
  
Joined: Thu Jun 01, 2006 1:24 pm
Posts: 104              Hi all,

Stumped I am!  I've got a MySQL database, been adding records from an old app 
for years and am porting some code to a new app to add records to one of the 
tables.  There are maybe 30 fields, variously integers and strings, and a brief 
description of what I'm trying to do in code looks like this:
Code:
dim db as MySQLDatabase
Dim rec as DatabaseRecord
db = connectdb // this is just a Method I use to store the login and server 
info, I've confirmed that it is returning the database correctly because some 
SELECT queries run before my insert return good results...

rec = new DatabaseRecord
rec.Column("JobName") = "foo"
rec.IntegerColumn("Priority") = 50
..
Another 25 or so columns set up and populated
..
db.InsertRecord("Jobs", rec)
MsgBox "Database Error: " + str(db.ErrorCode) + EndOfLine + EndOfLine + 
db.ErrorMessage


Well, the code compiles (no string/integer conversion errors) and runs, and 
when I run this code it runs all the way through and I get a messagebox 
"Database Error: 0"  which makes me think there's no error.

However, there is no record in the database table with the name "foo" - it's as 
though the InsertRecord just went into thin air.  

Confused and flummoxed I am!  The older program from which I pulled my code 
snippets was written a couple of years ago, but I'm fairly certain I've 
corrected for deprecated functions/properties...perhaps not?

Many thanks for any help y'all can provide!
 Steve   
                            Top               jefftullin           Post 
subject: Re: InsertRecord not failing, but not creating record eitherPosted: 
Sat Dec 05, 2009 2:19 am                        
Joined: Wed Nov 15, 2006 3:50 pm
Posts: 1039              db.Commit ?   
                            Top           Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 2 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