New topic: Unable to connect to DB
<http://forums.realsoftware.com/viewtopic.php?t=46926> Page 1 of 1 [ 6 posts ] Previous topic | Next topic Author Message Tegwin Post subject: Unable to connect to DBPosted: Tue Feb 12, 2013 6:08 pm Joined: Fri Nov 18, 2005 7:26 pm Posts: 10 Hello, I am trying to add some data to a database. I have a few text boxes on the window and when I click the add button noting happens. i have created the database Called Contacts with a Table called dim dr as new DatabaseRecord dr.Column("Name") = trim(textname.text) dr.Column("Address") =trim(textaddress.text) dr.Column("Tel") =trim(texttel.text) People.InsertRecord "Contacts" , dr People.commit What am I doing wrong . I am using a built in RealDBDatabase Thanks Chris Top HMARROQUINC Post subject: Re: Unable to connect to DBPosted: Tue Feb 12, 2013 6:15 pm Joined: Sun Jan 25, 2009 5:11 pm Posts: 425 Location: Guatemala, Central America Is this a database you added to the IDE? Are you connecting to the database manually? _________________ Future RS guru. Ride the world! Top Tegwin Post subject: Re: Unable to connect to DBPosted: Tue Feb 12, 2013 6:20 pm Joined: Fri Nov 18, 2005 7:26 pm Posts: 10 I added it in via the IDE. Top DaveS Post subject: Re: Unable to connect to DBPosted: Tue Feb 12, 2013 6:38 pm Joined: Sun Aug 05, 2007 10:46 am Posts: 4545 Location: San Diego, CA I am "assuming" your Database is called "PEOPLE" and the Table is called "CONTACTS" a) what error message are you getting? [hint... you need to add error checking code after your InsertRecord] b) where is the code to CONNECT to the database? [connections need to be explict] Just because a database exists, doesn't mean your can read/write to it. It must be opened first. _________________ Dave Sisemore MacPro, OSX Lion 10.7.4 RB2012r1 Note : I am not interested in any solutions that involve custom Plug-ins of any kind Top Tegwin Post subject: Re: Unable to connect to DBPosted: Tue Feb 12, 2013 6:50 pm Joined: Fri Nov 18, 2005 7:26 pm Posts: 10 There is no error.. Just does not write anything I have not added anything else, I assmued it was taken care of Where do I go to connect to the DB Top DaveS Post subject: Re: Unable to connect to DBPosted: Tue Feb 12, 2013 6:57 pm Joined: Sun Aug 05, 2007 10:46 am Posts: 4545 Location: San Diego, CA How do you know there was no error? You have no error checking code. And to be honest.. the fact that you asked this question "Where do I go to connect to the DB", leads me to believe that you did not connect to the database, and there for your attempt to insert a record DID result in errors. Be aware... Database errors, and RealStudio "unhandled exceptions" are not the same. Database errors are silent unless you trap them and deal with them, while an "unhandled exception" will usually abort your program. _________________ Dave Sisemore MacPro, OSX Lion 10.7.4 RB2012r1 Note : I am not interested in any solutions that involve custom Plug-ins of any kind Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 6 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]
