Thanks for the reply, I realize that user variables disappear when the connection closes but I don't understand why what I'm trying to accomplish can't be done. Doesn't it make since that if you can load a single file with multiple SQL commands and have that work succesfully then you should be able to have a single call with multple SQL commands work just as succesfully? Is there any way to do what I asked in my original post? Thanks again for the reply.
>>> Paul DuBois <[EMAIL PROTECTED]> 4/23/05 12:12:32 PM >>> At 22:04 -0700 4/22/05, Ed Reed wrote: >Thanks for the reply, > >So is there anyway to use User Variables with a single connection. >All my apps are in VB6 and VBA. They all take a query, open a >connection, run query, fill array from query results, close >connection and pass back the array. Because of backward >compatibility there's no way I can change them to do otherwise. User variables disappear when the connection closes. > >Thanks again. > >>>> Chris < [EMAIL PROTECTED] > 04/22/05 7:56 PM >>> >Ed Reed wrote: > >>If I run the following in MySQLFront v3.1 >> >>Set @A='Test'; >>Select @A; >> >>I get back same result >> >>+------+ >>| @A | >>+------+ >>| Test | >>+------+ >> >>If I run the same query in MySQL Query Browser v1.1.6 I get this, >> >>ErrNo 1060, You have an error in your SQL syntax; check the manual >>that corresponds to your MySQL server version for the right syntax >>to use near '; >>select @A' at line 1 >> >>and If I run the same query in my application I get the same error >>as the Query Browser. >> >>Anyone know how I can get my application to give me what I'm looking for? >> >> >> >The command line interface allows you to run multiple commands at once. >The Query Browser and PHP interfaces allow only one query per function >call. So mysql_query('SET @A; SELECT @A;') would fail. You need to run >each query separately. > >This is certainly the case in your application, even if it's not PHP. > >If you ran the queries separately in the Query Browser, you wouldn't get >the results you expect. It would forget the value of @A because it >closes the connection each time. It's possible to keep the connection >open by Starting a transaction (even if you're using MyISAM tables). > >Chris > >-- >MySQL General Mailing List >For list archives: http://lists.mysql.com/mysql >To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] > > > >-- >MySQL General Mailing List >For list archives: http://lists.mysql.com/mysql >To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- Paul DuBois, MySQL Documentation Team Madison, Wisconsin, USA MySQL AB, www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]