[odb-users] using values in MySQL DB to create all objects
Loncar, Bob
Bob.Loncar at halton.ca
Tue Apr 14 10:10:21 EDT 2015
I have been able to build the compiler, odblib and libmysql. I am trying to work with the hello example. I have been able to get it to build but when I try to run it I get an error saying "The program can't start because odb-2.4-vc10.dll is missing from your computer". I checked and the file is there in the appropriate directory yet I can't register it using regsvr32. I tried using elevated command prompt and tried both the 64 bit and 32 bit versions of regsvr32. I'm on windows 7 64 bit using visual studio 2010, and I have built all the projects using release 64 bit. Any ideas?
[cid:image001.png at 01D0769B.3746F530]
Bob Loncar
SCADA Programmer
The Regional Municipality of Halton
1151 Bronte Rd.
Oakville, Ont. L6M 3L1
Tel: 1-866-442-5866 ext 3073
Cell: 289-795-3085
Email: Bob.Loncar at halton.ca
-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com]
Sent: Friday, April 10, 2015 10:52 AM
To: Loncar, Bob
Cc: 'odb-users at codesynthesis.com'
Subject: Re: [odb-users] using values in MySQL DB to create all objects
Hi Bob,
Loncar, Bob <Bob.Loncar at halton.ca<mailto:Bob.Loncar at halton.ca>> writes:
> I want to use the DB for creating all the objects. First I would
> manually populate the tables/columns in my DB based on what I need,
> then I would like to create all the objects from the DB to be used
> within my main() and then save any changes made to the objects during
> runtime back to the DB. I have no need to create new objects in my
> code that will then persist in the DB. My question is how to create a
> transaction that grabs all records within a table and create objects
> based on those records.
Take a look at Section 2.5, "Querying the Database for Objects"
in the "Hello, World" chapter in the manual (BTW, if you haven't read this chapter completely, I strongly suggest that you do).
If you want to get all the objects rather than a subset that matches a certain criteria, then all you have to do is omit the condition in the call to query(), for example, change:
result r (db->query<person> (query::age > 30));
To:
result r (db->query<person> ());
And you will get all the person object in the database.
Boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 15498 bytes
Desc: image001.png
Url : http://codesynthesis.com/pipermail/odb-users/attachments/20150414/45aad3a5/image001.png
More information about the odb-users
mailing list