1. each environment:
1.1 ODB: 2.4.0 (32bit)
1.2 visual stdio 2013 (32bit)
1.3 SQL Server 2012 (32bit)
2. ODB Download
Download: http://www.codesynthesis.com/products/odb/download.xhtml
2.1 download ODB Compiler: odb-2.4.0-i686-windows
2.2 download Common Runtime Library: libodb-2.4.0
2.3 下载Database Runtime Libraries: libodb-mssql-2.4.0
2.4 download Examples: odb-examples-2.4.0
3. Install ODB
3.1 Unzip the downloaded odb-2.4.0-i686-windows
3.2 bin directory to environment variable (Computer -> Properties -> Advanced System Settings -> Environment Variables)
3.3 odb enter on the command line --version to see if the installation was successful:
Success follows:
Debug version of the compiler and the running instance of the program:
4. Compile ODB core library, ODB's library mssql, mssql library
4.1 core library compiled ODB
4.1.1 decompression libodb-2.4.0
4.1.2 enter libodb-2.4.0 Open libodb-vc12.sln (vs2013)
4.1.3 Rebuild ODB core library directly vs2013:
In libodb-2.4.0-> bin: odb-d-2.4-vc12.dll
In libodb-2.4.0-> bin: odb-d.lib
4.2 ODB generation of libraries mssql, mssql library
4.2.1 decompression libodb-mssql-2.4.0
4.2.2 enter libodb-mssql-2.4.0 Open libodb-mssql-vc12.sln (vs2013)
4.2.3 Add property to the directory containing the project: D: \ ODB \ libodb-2.4.0 \ (position actual libodb-2.4.0 decompression according to)
4.2.4 Set library directory: D: \ ODB \ libodb-2.4.0 \ lib
4.2.5 regenerate the ODB database mssql, mssql library in vs2013:
The ODB mssql library: libodb-mssql-2.4.0 \ bin \ odb-mssql-d-2.4-vc12.dll
mssql库: libodb-mssql-2.4.0\lib\odb-mssql-d.lib
5. Run ODB example (hello-mssql-vc12)
5.1 decompression odb-examples-2.4.0
5.2 entering odb-examples-2.4.0 Open examples-mssql-vc12.sln
5.3 Examples of the above two projects require header files and libraries of the project:
vs2013 the hello-mssql-vc12 project set to start
The dependent dynamic runtime library odb-d-2.4-vc12.dll, odb-mssql-d-2.4-vc12.dll .exe copied to the directory generated:
Examples here have been generated and can be performed, but the operation failed database:
Change the following:
Instead the actual database logon information:
My database:
person.sql database script generation table in the database 5.4 Login run the examples directory.
Table 5.5 after a successful operation to generate examples:
5.6 Examples of successful operation: