Want to use the BDE guide Access database to create an ODBC data source. I didn't see the code written by BCB for a long time, so I have rewritten one. If there is any shortcomings, please correct it. ========jianlinlong@163.net
/ * Function function: Create an Access ODBC Data Source Enter Parameters: DSN -------- The name of the Access ODBC data source to be created strMdbfile --------- Access library files STRDESC -------- Description of this data source strloginuser --------- User name strpassword for the file referred to since Strmdbfile ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ "Sign in StrMdbfile" Password return value: successfully returns true, otherwise you will throw an Exception (this will there be a problem?) Usage: (1) CreateAccessDSN ("jll_access", "C: // Windows // Desktop // StarSo. "); (2) CreateAccessDSN (" JLL_Access2 "," C: //Windows//desktop//starso.mdb "," "," admin "," ok_pwd "); Note: #include
using namespace std; * / bool __fastcall CreateAccessDSN (const AnsiString & DSN, const AnsiString & strMDBFile, const AnsiString & strDesc = "no descript", const AnsiString & strLoginUser = "", const AnsiString & strPassword = "") {auto_ptr