40 std::string connInfo(
"file://");
41 std::string data_dir = TERRALIB_DATA_DIR;
42 std::string user, pass, path;
44 std::cout <<
"Inform the location of your Microsoft Access database (ENTER to accept default \'" << (data_dir +
"/ado/ADODataSource.mdb") <<
"\'): ";
45 std::getline(std::cin, path);
47 std::cout <<
"Inform the user to access your Microsoft Access database (ENTER if there is none): ";
48 std::getline(std::cin, user);
50 std::cout <<
"Inform the Password to access Microsoft Access database (ENTER if there is none): ";
51 std::getline(std::cin, pass);
53 connInfo += user.empty() ?
"" : user +
":";
54 connInfo += pass.empty() ?
"" : pass +
"@";
55 connInfo += path.empty() ? (data_dir +
"/ado/ADODataSource.mdb") : path;
58 connInfo +=
"?PROVIDER=Microsoft.Jet.OLEDB.4.0";
60 connInfo +=
"?PROVIDER=Microsoft.ACE.OLEDB.12.0";
72 catch (
const std::exception& e)
74 std::cout << std::endl <<
"An exception has occurred: " << e.what() << std::endl;
78 std::cout << std::endl <<
"An unexpected exception has occurred!" << std::endl;
static std::unique_ptr< DataSource > make(const std::string &driver, const te::core::URI &connInfo)
Examples that show how to access/manipulate an ADO data source.
static te::dt::Date ds(2010, 01, 01)
std::unique_ptr< te::da::DataSource > GetADOConnection()
A factory for data sources.
Utility functions for the data access module.
This file contains include headers for the TerraLib Common Runtime module.