Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: tushar Kanvinde
  Where is tushar Kanvinde?
 Kolhapur, Maharastra
 India
 tushar Kanvinde
 To: joe Degorio
  Where is joe Degorio?
 Tacloban City
 Philippines
 joe Degorio
 Tags
Subject: RE: Question on SQL command
Thread ID: 209643 Message ID: 209650 # Views: 25 # Ratings: 0
Version: Visual FoxPro 8 Category: Databases, Tables and SQL Server
Date: Tuesday, December 30, 2008 9:11:00 AM         
   


> Hello everyone,
> Happy New Year to all!!
> I'm new to using MySql and I got an error on my application saying "Too many connections..." I'm using Xampp with MySql and this is the code im using to connect to my database...
>
> lcServer="localhost"
> lcDatabase="mydata"
> lcUser = "root"
> lcPassword = ""
> lcStringConn="Driver={MySQL ODBC 3.51 Driver};Port=3306"+;
> ";Server="+lcServer+;
> ";Database="+lcDatabase+;
> ";Uid="+lcUser+;
> ";Pwd="+lcPassWord
> *** Don't prompt for login
> SQLSETPROP(0,"DispLogin",3)
>
> h = SQLSTRINGCONNECT(lcStringConn)
>
> IF h > 0
> WAIT WINDOW "Database is now Connected!" TIMEOUT 1
> ELSE
> * =AERROR(laError)
> MESSAGEBOX("Error at Connecting"+chr(13)+"Please contact the Administrator to fix the error...",48," Pharmacy System V.01")
> * "Description:"+laError[2])
> *quit
> ENDIF
>
> 1.] My question is... is something wrong using Xampp(MySql)?
> 2.] Do I have to issue SQLDISCONNECT() after query is obtained?
>
>
> Thanks in advance,
> joe

You should have a single global connection which you use instead of a connection for each query.

Regards
Tushar

ENTIRE THREAD

Question on SQL command Posted by joe Degorio @ 12/30/2008 8:33:06 AM
RE: Question on SQL command Posted by tushar @ 12/30/2008 9:11:00 AM
RE: Question on SQL command Posted by joe Degorio @ 12/30/2008 9:43:43 AM
RE: Question on SQL command Posted by Pete Sass @ 1/1/2009 12:13:53 AM
RE: Question on SQL command Posted by joe Degorio @ 1/1/2009 1:25:18 PM
RE: Question on SQL command Posted by Pete Sass @ 1/2/2009 11:31:34 PM
RE: Question on SQL command Posted by Victor Friedman @ 8/9/2010 3:33:55 PM
RE: Question on SQL command Posted by Anders Altberg @ 8/9/2010 3:52:33 PM
RE: Question on SQL command Posted by Victor Friedman @ 8/9/2010 3:56:57 PM
RE: Question on SQL command Posted by Anders Altberg @ 8/9/2010 4:45:39 PM
RE: Question on SQL command Posted by Tom Saddul @ 8/9/2010 4:46:36 PM
RE: Question on SQL command Posted by Anil Sharma @ 8/9/2010 5:04:08 PM
RE: Question on SQL command Posted by Tom Saddul @ 8/9/2010 6:42:01 PM