[Gambas-user] Issue 601 in gambas: Database Data Source with Mariadb as mysql

gambas at ...2524... gambas at ...2524...
Sun Feb 8 05:09:09 CET 2015


Comment #9 on issue 601 by justlost... at ...626...: Database Data Source with  
Mariadb as mysql
https://code.google.com/p/gambas/issues/detail?id=601

Hi I found that the following code did not est for connection and therefore  
was leaving vVal as null it never actually set the Connection Value.

Public Function SaveProperty() As Boolean

   Dim sVal As String
   Dim vVal As Variant
   Dim hCtrl As CControl
   Dim sMsg As String
   Dim sOldVal As String

   If Not $hForm Or If Not Object.IsValid($hForm) Then Return
   If $hForm.ReadOnly Then Return
   If IsNull($hEditor) Then Return False

   sVal = $hEditor.Text
   If sVal = $sOldVal Then Return False
   sOldVal = sVal

   Select $sType

     Case "Name"

       If Not sVal Then Goto _CANCEL

       If CControl.CheckName(sVal) Then
         sMsg = ("Forbidden characters in control name.")
         Goto _CANCEL
       Endif

       If $hObject.Rename(sVal) Then
         sMsg = ("This name is already in use.")
         Goto _CANCEL
       Endif

       RefreshOne($hObject, "Name")
       Return False

     Case "Group"

       If CControl.CheckName(sVal) Then
         sMsg = ("Forbidden characters in control group.")
         Goto _CANCEL
       Endif

       vVal = sVal

     Case "i", "l", "b", "Range", "Position", "Dimension"

       Try vVal = CInt(Val(sVal))
       If Error Then Goto _BAD

     Case "f"

       If Not IsNumber(sVal) Then Goto _BAD
       vVal = CFloat(Val(sVal))

     Case "d"

       If Not IsDate(sVal) Then Goto _BAD
       vVal = CDate(Val(sVal))

     Case "Color"

       If Not IsNull(Val(sVal)) Then
         vVal = Val(sVal)
       Else
         vVal = sVal
       Endif

      
Case "s", "Font", "Picture", "Constant", "List", "Path", "Image", "SvgImage", "ReportCoord", "ReportPadding", "ReportBorder", "ReportBrush", "Field", "Menu", "Table", "Connection"
       'Added Connection to above line Brian G.
       vVal = sVal

     Case "String[]", "Fields", "Field[]"

       Try vVal = Split(sVal, "\n")
       If Error Then Goto _BAD

     Case "Angle"

       vVal = $hEditor.Value

     Case Else ' Object

       'RETURN FALSE

   End Select

   $bIgnoreCancel = True

   CControl.LastError = ""

   If $bMany Then

     For Each hCtrl In $hForm.Selection
       If hCtrl.SetProperty($sLast, vVal) Then Goto _BAD
     Next

   Else

     If $hObject.SetProperty($sLast, vVal) Then Goto _BAD

   Endif

   $bIgnoreCancel = False

   $sOldVal = sOldVal
   'DEBUG "$sOldVal =";; $sOldVal
   Return

_BAD:

   sMsg = ("Incorrect property value.")
   If CControl.LastError Then sMsg &= "\n\n" & CControl.LastError
   $bIgnoreCancel = False

_CANCEL:

   CancelProperty
   $hEditor.SetFocus
   If sMsg Then Balloon.Warning(sMsg, grdProperty, panEditor.X -  
grdProperty.X + panEditor.W / 2, panEditor.Y - grdProperty.Y + panEditor.H  
/ 2)
   Return True

End


-- 
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings




More information about the User mailing list