dbaccess via odbc [message #16805] |
Sat, 12 July 2008 12:05 |
maxmeier
Messages: 9 Registered: July 2008 Location: Nürnberg
|
Promising Member |
|
|
Hi all,
i'm looking for a direct odbc approach to database (must connect to MS Access and DB2).
All i found in the forum was msg. #7788 where a package for that purpose is announced (msg was posted in Jan/2007). What's the current state about that?
And if odbc is possible: is there an example?
Thanks + greets
maxmeier
[Updated on: Sat, 12 July 2008 12:48] Report message to a moderator
|
|
|
Re: dbaccess via odbc [message #16806 is a reply to message #16805] |
Sat, 12 July 2008 13:00 |
|
There is no plugin for upp database package. In my database explorer I use odbc directly (I have my own sql/connection classes) - it's not so hard. Unfortunately my code is too mixed with other database explorer parts to be posted here.
Remember that you can always use OleDb. Upp supports it very well.
|
|
|
Re: dbaccess via odbc [message #16807 is a reply to message #16806] |
Sat, 12 July 2008 14:33 |
maxmeier
Messages: 9 Registered: July 2008 Location: Nürnberg
|
Promising Member |
|
|
Hi,
thanks for your answer. I added OleDB and Sql packages and tried the following...
#include <Core/Core.h>
#include <OleDB.h>
using namespace Upp;
CONSOLE_APP_MAIN
{
OleDBSession sess;
}
...and got a compile error from win sdk and moreover compiler says that "OleDBSession" is not known:
c:\program files\microsoft sdks\windows\v6.0a\include\ocidl.h(2809) : error C2061: Syntaxfehler: Bezeichner 'CY'
c:\program files\microsoft sdks\windows\v6.0a\include\ocidl.h(2812) : error C2061: Syntaxfehler: Bezeichner 'CY'
D:\cpp_projects\MyApps\CoreConsole1\CoreConsole1.cpp(12) : error C2065: 'OleDBSession': nichtdeklarierter Bezeichner
Can you help?
BTW: where can I have a look into your database explorer? Couldn't find something like that in the upp-sources.
Bye
maxmeier
[Updated on: Sat, 12 July 2008 14:45] Report message to a moderator
|
|
|
|
|
|
Re: db access via odbc [message #18104 is a reply to message #18102] |
Wed, 10 September 2008 16:23 |
lgon
Messages: 4 Registered: September 2008 Location: Tenteniguada
|
Junior Member |
|
|
here is my manveic.h
#ifndef _manveic_manveic_h
#define _manveic_manveic_h
#include <CtrlLib/CtrlLib.h>
#include <OleDB/OleDB.h>
using namespace Upp;
#define LAYOUTFILE <manveic/manveic.lay>
#include <CtrlCore/lay.h>
class cprincipal : public WithcprincipalLayout<TopWindow> {
typedef cprincipal CLASSNAME;
public:
MenuBar menu;
OleDBSession bd;
cprincipal();
void Exit();
void SubMenu(Bar& bar);
void SubMenuListados(Bar& bar);
void MainMenu(Bar& bar);
void NuevoVehiculo();
void ListadoVehiculos();
};
#endif
and here is the main.cpp
#include "manveic.h"
cprincipal::cprincipal()
{
CtrlLayout(*this, "");
Title("Mantenimiento de Vehículos").Sizeable();
AddFrame(menu);
menu.Set(THISBACK(MainMenu));
bd.Open("admin"¸ ""¸ "C:\\Users\\Luis\\Carpeta de Trabajo\\mantenimiento vehiculos\\gastos.mdb"¸ "Microsoft.Jet.OLEDB.4.0");
}
GUI_APP_MAIN
{
cprincipal().Run();
}
The errors:
In file included from C:\Users\Luis\Carpeta de Trabajo\manveic\main.cpp:1:
C:\Users\Luis\Carpeta de Trabajo\manveic\/manveic.h:17: error: 'OleDBSession' does not name a type
C:\Users\Luis\Carpeta de Trabajo\manveic\main.cpp: In constructor 'cprincipal::cprincipal()':
C:\Users\Luis\Carpeta de Trabajo\manveic\main.cpp:10: error: 'bd' was not declared in this scope
[Updated on: Wed, 10 September 2008 16:24] Report message to a moderator
|
|
|
|
|
|
|