Welcome to the CC ++ programming community forum, and interact with 2 million technical staff to enter 2) compress *. MDB files. # Includeadojet. hstaticconstTCHARszSrc [] _ T (ProviderMicrosoft. Jet. OLEDB.4.0;) _ T (performancec: \ TEST1.MDB;); _ T (JetOLEDB: EngineType5; JetOLEDB: D
Welcome to the C/C ++ programming community forum to interact with 2 million technical staff> go to 2) compress *. MDB files. # Include adojet. h static const TCHAR szSrc [] = _ T ("Provider = Microsoft. jet. OLEDB.4.0; ") _ T (" Data Source = C: \ TEST1.MDB; "); // _ T (" Jet OLEDB: Engine Type = 5; Jet OLEDB: D
Welcome to the C/C ++ programming Community Forum and interact with 2 million technical staff> enter
2) compress the *. MDB file.
# Include
Static const TCHAR szSrc [] =
_ T ("Provider = Microsoft. Jet. OLEDB.4.0 ;")
_ T ("Data Source = C: \ TEST1.MDB ;");
// _ T ("Jet OLEDB: Engine Type = 5; Jet OLEDB: Database PassWord = ??? ");
Static const TCHAR szDst [] =
_ T ("Provider = Microsoft. Jet. OLEDB.4.0 ;")
_ T ("Data Source = C: \ TEST2.MDB ;");
// _ T ("Jet OLEDB: Engine Type = 5; Jet OLEDB: Database Password = ??? ");
Jet OLEDB: Engine Type = 5 indicates that the MDB File of ms jet 4x is used. If this attribute is not provided, the system automatically converts the compressed MDB file to the latest version.
CComPtr Engine;
// If (SUCCEEDED (Engine. CoCreateInstance (_ uuidof (JetEngine ))))
If (SUCCEEDED (Engine. CoCreateInstance (L "JRO. JetEngine ")))
{
Engine-> CompactDatabase (CComBSTR (szSrc), CComBSTR (szDst ));
} MS documentation indicates that the JET component is no longer included since MDAC2.6, and MDAC2.7 is the last version of JRO, and JRO cannot be used on WIN64. It looks like M $ is encouraging us to use SQL SERVER.
[1] [2]