[Gambas-user] Table doens't exist while saving data

Fabricio Silva buxaman at ...626...
Mon Aug 14 15:54:00 CEST 2006


*I'm trying to save data using class file instead of module. So I have
declared into the class global*

STATIC PUBLIC db AS NEW Connection
PUBLIC CONST dbname AS String = "geral"
PUBLIC CONST host AS String = "localhost"
PUBLIC CONST passw AS String = "teste"
PUBLIC CONST login AS String = "root"

*and the procedure to conect:*

STATIC PUBLIC FUNCTION conexao() AS Boolean
  db.close
  db.Type = "mysql"
  db.Host = host
  db.Login = login
  db.Password = passw
  db.Name = dbname
  db.Open

  RETURN TRUE
CATCH
  RETURN FALSE

END

*Then I used the code:*

PUBLIC global AS FrmPrincipal

PUBLIC SUB Form_Open()
  ME.center
  global = NEW FrmPrincipal
END

*And Finally to save the data:*

PUBLIC SUB btnsol_Click()
DIM db1 AS NEW Connection
DIM dbname AS String
DIM htable AS Result
DIM comsql AS String

    SELECT CASE LAST.tag
      CASE 1
        db1.Close
        dbname = "geral"
        db1.Type = "mysql"
        db1.Host = "localhost"
        db1.Login = "root"
        db1.Password = "teste"
        db1.Open
        db1.Begin
        global.rs = db1.Exec("insert into `teste` values (&1)", txtteste)
....

*And the error: Table mysql.teste doens't exit*

The table exist and I recreated it to make sure it's not wrong spelling.
Someone have an ideal of what I am forgeting? Must be something like telling
gambas wich table must I use?

tks

Fabricio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20060814/8aeb9f1b/attachment.html>


More information about the User mailing list