Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / Database and wxWindows

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Database and wxWindows
#5629
Posted by: giakkk 2004-12-22 19:12:34
Hi all here's my code,

if(!ctrl){
    SDWORD cb,cb1;
    ULONG ID;
    int id;
    wxString sqlStmt,priv;
    wxChar PRIV;
    sqlStmt = "SELECT id,priv FROM anag_op WHERE nome='"+*n+"' AND cognome='"+*c+"' AND pass='"+*p+"'";
    id=-200;
    if (!db->ExecSql(sqlStmt))
    {
        er->generaErrore("Errore#4","...");
        return FALSE;
    }
    if (!db->GetNext())
    {
        er->generaErrore("Errore#5","...");
        return FALSE;
    }   
    if (!db->GetData(1, SQL_C_ULONG, &ID, 0, &cb)){
                er->generaErrore("Errore#6","...");
                return FALSE;
    }else{
        id=(int)ID;
    }    
    if (!db->GetData(2, SQL_C_CHAR, &PRIV, 0, &cb1)){
                er->generaErrore("Errore#7","....");
                return FALSE;
    }else{
        priv=PRIV;
    }   
        ses_priv=priv;
        ses_id=id;
        return TRUE;  
    }
    return FALSE;
}   

The problem is that ses_id doesn't contain any data, what's wrong in this code?
I don't have compile error, just an empty(?) variable that it shouldn't be empty...

Thanks a lot
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Tue 2024-10-8  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0