New topic: My Program crash under win Xp. Need help to understand.
<http://forums.realsoftware.com/viewtopic.php?t=46225> Page 1 of 1 [ 5 posts ] Previous topic | Next topic Author Message Antonio Post subject: My Program crash under win Xp. Need help to understand.Posted: Wed Dec 12, 2012 4:30 pm Joined: Sat Feb 04, 2012 1:26 pm Posts: 44 Hi, Program runs corretly under windows 7 and Vista but it crashes under windows Xp. Crash come out when pushing a button that updates a mdb file via Sql. By erasing, step by step, the code portion inside the button's action event, I isolated the part of the code that make the program crash: If db.Connect then rs=db.SQLSelect("SELECT * FROM table1 where name = ' " + popupmenu1.text + " ' ") while not rs.EOF cdr = rs.field("Code").integervalue rs.MoveNext wend else MsgBox "Connection failed!" end if it seems it connects to the db but crash, as the "connection failed" msg does not appear. it propably seems to crash at the rs=db.SQLSelect..... statement. I also tried to change: rs=db.SQLSelect("SELECT * FROM table1 where name = ' " + popupmenu1.text + " ' ") with rs=db.SQLSelect("SELECT * FROM table1 where name = ' " ...a known value from the name field.. " ' ") and it still crashes. any idea ? Top timhare Post subject: Re: My Program crash under win Xp. Need help to understand.Posted: Wed Dec 12, 2012 5:47 pm Joined: Fri Jan 06, 2006 3:21 pm Posts: 11881 Location: Portland, OR USA Quote:any idea ? Yes. Add a little error checking to your code. You're likely getting an sql error of some kind. Never use an object returned from a database without checking it for validity. rs=db.SQLSelect("...") if db.Error then MsgBox(db.ErrorMessage) if not (rs is nil) then while not rs.EOF if not (rs.field("Code") is nil) then cdr = rs.Field("Code").integervalue end rs.MoveNext wend end Top Antonio Post subject: Re: My Program crash under win Xp. Need help to understand.Posted: Wed Dec 12, 2012 6:06 pm Joined: Sat Feb 04, 2012 1:26 pm Posts: 44 Timhare, program continue to crash without showing any error message. Top timhare Post subject: Re: My Program crash under win Xp. Need help to understand.Posted: Wed Dec 12, 2012 6:13 pm Joined: Fri Jan 06, 2006 3:21 pm Posts: 11881 Location: Portland, OR USA Does it crash with an exception? Or a Windows crash message? Top Antonio Post subject: Re: My Program crash under win Xp. Need help to understand.Posted: Wed Dec 12, 2012 6:39 pm Joined: Sat Feb 04, 2012 1:26 pm Posts: 44 A windows popup message appeared once, referring to dr watson. It also showed tbere where some problem with ntdll.dll Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 5 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]
