New topic: 

CubeSQL Thread question

<http://forums.realsoftware.com/viewtopic.php?t=45711>

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        sergiotamborini          Post subject: CubeSQL Thread 
questionPosted: Wed Oct 24, 2012 4:27 pm                         
Joined: Tue Feb 06, 2007 6:11 am
Posts: 59                Hi all.
I open a connection to a remote CubeSQL server into a thread. Into this thread 
I make a simple "select" query. I do into a thread because the user can 
continue his work during this operation.
It works all ok, when I have an internet connection active, but when the user 
is not connected, every time my app executes the thread, the application 
freezes for some seconds.
Is there a way to avoid this annoying issue?

Here some code:

- Into a timer (active every 1/2 hour)
dim MyTh As ThreadUpdate

MyTh=new ThreadUpdate(param1,param2)

myth.Run


- into the run of the thread I have:
dim rs As RecordSet

ThConnectDbSupport
if ThSupportDb.Connect then
  rs=ThSupportDb.SQLSelect("select ...")
  if rs=nil Then
  'errore
  MsgBox ThSupportDb.ErrorMessage
  else
  if not rs.EOF Then
  'show a message
  end if
  end if
  ThSupportDb.Close
end if
end if


- and then in the ThConnectDBSupport method I have the parameters for connection
Private Sub ThConnessioneDbSupporto()
  ThSupportDb=New CubeSQLServer
  ThSupportDb.host=DecodeBase64(ThVarX1)
  ThSupportDb.DatabaseName=DecodeBase64(ThVarX2)
  
  ThSupportDb.UserName=DecodeBase64(ThVarX3)
  ThSupportDb.Password=DecodeBase64(ThVarX4)
End Sub


Thanks a lot!   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
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]

Reply via email to