[Gambas-user] Second Form not reading Public variable from first form

rocko sunblaster5 at ...626...
Thu Aug 9 21:57:16 CEST 2012


DOH!!
Originally I was getting an error on rTable and $hConn variable "Null
Object" or something like that.
Think thats why I added the $hConn statements, it got rid of the "null"
error but then other error's popped up.

Must remember only open sqlite once!!!
Thanks Oliver.

On Thu, 2012-08-09 at 21:48 +0200, Olivier Cruilles wrote:
> You repeat the same problem than yesterday.
> 
> 
> 
> Cordialement,
> 
> Olivier Cruilles
> Mail: linuxos at ...1896...
> 
> Le 9 août 2012 à 21:37, rocko <sunblaster5 at ...626...> a écrit :
> 
> FNew CODE:>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> ' Gambas class file
> 
> ' 
> Private rTable As Result        
> 
> 
> Public Sub btnCommit_Click()
> 
>  FMain.$hConn = New Connection     <-  ERROR you don't need to reopen the database, it's already done
>  FMain.$hConn.Open                             <-  ERROR you don't need to reopen the database, it's already done
> 
>  rTable = FMain.$hConn.Create("inventory") 
> 
>  If rTable.Available Then
>    rTable!name = txtName.Text
>    rTable!type = txtType.Text
>    Try rTable.Update
>    If Error Then
>      Print "Update failed"
>      Message.Error(ERROR.Text)
> 
>      Endif
>  Endif
> 
>  FMain.$hConn.Commit      <-  ERROR corrected
> 
> 
> End
> 
> Public Sub btnCancel_Click()
> 
>  FNew.Close
> 
> End
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user






More information about the User mailing list