Sub btchange_Click (Params As Map)
Main.AppLog("btchange :: Start")
Dim request As HttpRequest
Dim m As ResultSet
Dim tmpfrom As String = "r"
Dim tmpto As String = "r"
m = DB.pool.GetConnection.ExecQuery("SELECT devises FROM devise WHERE id = " & DefCurr)
Do While m.NextRow
tmpfrom = m.GetString("devises")
Loop
m.Close
Log("Premier")
If tmpfrom <> "r" Then
m = DB.pool.GetConnection.ExecQuery("SELECT devises FROM devise WHERE id = " & Curr) ' Time out here
Log("Deuxieme")
Do While m.NextRow
tmpto = m.GetString("devises")
Loop
m.Close
DB.pool.GetConnection.Close
Main.AppLog(URL & tmpfrom.SubString2(0,3) & "&ToCurrency=" & tmpto.SubString2(0,3))
request.InitializeGet(URL & tmpfrom.SubString2(0,3) & "&ToCurrency=" & tmpto.SubString2(0,3))
request.Timeout = 10000
If HttpClient1.Execute(request, 1) = False Then Return
End If
Main.AppLog("btchange :: End")
End Sub