I have a very simple stack which contains a button script that will connect directly to a MySQL database (over the Internet) and run some simple queries.  
There are no handlers for "preOpenStack" "openStack"  "preOpenCard" or "openCard"
Whenever I open the stack, I get this error:
"There was an error in connecting to the database.  Please check that the connection fields are correct.
  Revdb error:  Can't connect to MySQL server on 'localhost' (10061)"
To find out when it occurred, I put handlers for the open messages and found that the error occurs AFTER the preOpenStack, but before the other three.
I tried building a standalone to see if that mattered.  Same error.
The stack functions perfectly.  But it throws an error when it opens.  What's happening? Is Rev trying to pre-fetch a connection to a localhost ODBC driver or something?
Rev 4.0.0 gm-1  Enterprise   Windows XP SP 3  
Thanks.
Ray
			
			
									
									
						Revdb error occuring because of "pre-fetch"??
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Revdb error occuring because of "pre-fetch"??
And furthermore.... why "localhost" ??? ! You said that your DB was distant.
I guess you're using the Database Query Builder ("Please check that the connection fields are correct.") ?
So : you should check the query menu... you might have a second one you forgot to erase.
(advice : you should access your DB by script. You'd have much more control and freedom)
			
			
									
									
						I guess you're using the Database Query Builder ("Please check that the connection fields are correct.") ?
So : you should check the query menu... you might have a second one you forgot to erase.
(advice : you should access your DB by script. You'd have much more control and freedom)
Re: Revdb error occuring because of "pre-fetch"??
I am NOT using query builder.  As best I can tell, there is no good reason ANY code having anything to do with a database should be executing when the stack is opening.
I have a button on the main card of the stack, that when clicked, will do a database open and a few queries. The database sits on the on-rev server and works perfectly. I don't make any calls involving localhost.
All of my DB access is via script.
So, the Query Builder clue is interesting, though. I've never actually opened the Query Builder. I will now, because I think your hunch that it is throwing the error is correct. In which case, this probably actually a rev bug.
			
			
									
									
						I have a button on the main card of the stack, that when clicked, will do a database open and a few queries. The database sits on the on-rev server and works perfectly. I don't make any calls involving localhost.
All of my DB access is via script.
So, the Query Builder clue is interesting, though. I've never actually opened the Query Builder. I will now, because I think your hunch that it is throwing the error is correct. In which case, this probably actually a rev bug.
Re: Revdb error occuring because of "pre-fetch"??
Brilliant.
It was the Query Builder.
There was an empty Query in there called Query 1.
I deleted it. Saved the stack. Closed the stack. Re-opened the stack - no error.
Thanks for the indirect pointer !
			
			
									
									
						It was the Query Builder.
There was an empty Query in there called Query 1.
I deleted it. Saved the stack. Closed the stack. Re-opened the stack - no error.
Thanks for the indirect pointer !
Re: Revdb error occuring because of "pre-fetch"??
OMG THANK YOU!!!! I had this same problem and couldn't figure out where the hell this error was coming from...it was driving me bonkers for a while.
			
			
									
									Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com
						Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com
