Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Error when compiling native MySql with MSC9
Re: Error when compiling native MySql with MSC9 [message #34302 is a reply to message #34301] Wed, 09 November 2011 21:42 Go to previous messageGo to previous message
BioBytes is currently offline  BioBytes
Messages: 307
Registered: October 2008
Location: France
Senior Member
Mirek,

Sorry and confused Embarassed for the following points:

First: double post (I did not see you reply so fast).

Second: I forgot to indicate in the package configuration that the project needs GUI MT and not MT alone.

Now no more linkage error but the application crashes. Please find herafter the header, cpp and schema files;

Header:

#ifndef _DirectDB_DirectDB_h
#define _DirectDB_DirectDB_h

#include <CtrlLib/CtrlLib.h>
#include <MySql/MySql.h>

using namespace Upp;

#define LAYOUTFILE <DirectDB/DirectDB.lay>
#include <CtrlCore/lay.h>

#define IMAGEFILE <DirectDB/DirectDB.iml>
#include <Draw/iml_header.h>

#define SCHEMADIALECT <MySql/MySqlSchema.h>
#define MODEL <DirectDB/DirectDB.sch>
#include <Sql/sch_header.h>

SqlId TBLPROCS("PROCESSUS"),NAME("NAMEPROC"),CODE("CODEPROC");

class DirectDBWin : public WithDirectDBWinLayout<TopWindow> {
public:
typedef DirectDBWin CLASSNAME;
MySqlSession session;

DirectDBWin();
};

#endif


Scheme file:

TABLE (OWNERS)
INT(IDOWNER)PRIMARY_KEY AUTO_INCREMENT
INT(IDPROCOWNER)
STRING_(OWNERNAME,200)
STRING_(OWNERFIRSTNAME,200)
STRING_(OWNERLOGON,20)
STRING_(OWNERSTATUS,1)
INT(IDPROC1)
INT(IDPROC2)
END_TABLE

TABLE (PROCESSUS)
INT(IDPROC)PRIMARY_KEY AUTO_INCREMENT
STRING_(CODEPROC,30)
STRING_(NAMEPROC,100)
END_TABLE

TABLE (SKILLS)
INT(IDSKILL)PRIMARY_KEY AUTO_INCREMENT
INT(IDPROCSKILL)
STRING(SKILL,400)
INT(IDRANGE)
END_TABLE

TABLE (SKILLSLEVEL)
INT(IDLEVEL)PRIMARY_KEY AUTO_INCREMENT
INT(IDSKILLLEVEL)
INT(SKILLLEVEL)
STRING_(OPENAME,200)
STRING_(OPEFIRSTNAME,200)
STRING_(OPESHORTID,20)
END_TABLE


cpp file:

#include "DirectDB.h"

#define IMAGECLASS DirectDBImg
#define IMAGEFILE <DirectDB/DirectDB.iml>
#include <Draw/iml.h>

#define SCHEMADIALECT <MySql/MySqlSchema.h>
#include <Sql/sch_source.h>

DirectDBWin::DirectDBWin()
{
CtrlLayout(*this, "Window title");
if(session.Connect("patrice","patrice","skillsdb","127.0.0.1 ",3306,NULL))
{
PromptOK("Connexion réussie");

SQL *Select(CODE,NAME).From(TBLPROCS);

while(SQL.Fetch())PromptOK(AsString(SQL[0])+" : "+AsString(SQL[1]));
}

else PanicMessageBox("Erreur","Pas de connexion possible");
}

GUI_APP_MAIN
{
SetLanguage(GetSystemLNG());
SetLNGCharset(GetSystemLNG(),CHARSET_UTF8);

DirectDBWin().Run();
}


Do you have any comments ? I have no idea of what is not working now.

Thank you again for your help

Biobytes

[Updated on: Wed, 09 November 2011 22:10]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: SqlMassinsert
Next Topic: Sqlite Delete not working [SOLVED]
Goto Forum:
  


Current Time: Tue May 14 18:30:14 CEST 2024

Total time taken to generate the page: 0.03502 seconds