New topic: 

Moving to mySql from SQLite  (Auto Increment problem )

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

         Page 1 of 1
   [ 3 posts ]                 Previous topic | Next topic          Author  
Message        JohnV          Post subject: Moving to mySql from SQLite  (Auto 
Increment problem )Posted: Fri Sep 07, 2012 2:11 pm                         
Joined: Sun Jan 28, 2007 2:38 pm
Posts: 127                I changed database backends from SQLite to mySQL.

Everything came over pretty easily except when we create a record.

In every table we have a field called ID  of type integer

The field is Auto_Increment. (AutoIncrement)

The problem is now upon calling  InsertRecord  we get in ID of '0'  (Zero) 
every time.

What am i missing?   
                             Top                Jym          Post subject: Re: 
Moving to mySql from SQLite  (Auto Increment problem )Posted: Fri Sep 07, 2012 
2:54 pm                         
Joined: Sat Oct 01, 2005 5:19 pm
Posts: 3120                And there's a reason you didn't want to include the 
code you use to create the table?

CREATE TABLE myTable
(
m_Id int NOT NULL AUTO_INCREMENT,
someColumn varchar(255),
PRIMARY KEY (m_ID)
)


or something like that I don't use mySQL   
                             Top                Bob Keeney          Post 
subject: Re: Moving to mySql from SQLite  (Auto Increment problem )Posted: Fri 
Sep 07, 2012 3:03 pm                                 
Joined: Fri Sep 30, 2005 11:48 am
Posts: 3210
Location: Lenexa, KS                JohnV wrote:I changed database backends 
from SQLite to mySQL.

Everything came over pretty easily except when we create a record.

In every table we have a field called ID  of type integer

The field is Auto_Increment. (AutoIncrement)

The problem is now upon calling  InsertRecord  we get in ID of '0'  (Zero) 
every time.

What am i missing?

I guess the first question I'd ask is are you absolutely 100% certain that it's 
actually inserting the record?  Very common for folks not to check the error 
bit.  Not saying you didn't but just running through my checklist.      
_________________
Bob K.

Get true Word Processing in your Real Studio applications with Formatted Text 
Control at http://www.bkeeney.com/products/formatted-text-control
36+ hours of Real Studio Video Training at http://www.bkeeney.com/
Real Studio Consulting http://www.bkeeney.com/consulting/real-studio-consulting 
 
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 3 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