wxdbconnectinfthis class is used for holding the data necessary for connecting to the odbc datasource. that information includes: sql environment handle, datasource name, user id, password and default directory path (used with dbase). other optional fields held in this class are and file type, both for future functions planned to be added for creating/manipulating datasource definitions.
wxdbconnectinf::wxdbconnectinf
wxdbconnectinf::wxdbconnectinfwxdbconnectinf() default constructor. wxdbconnectinf(henv henv, const wxstring &dsn, const wxstring &userid="", const wxstring &password, const wxstring &defaultdir="", const wxstring &description="", const wxstring &filetype="") constructor which allows initial settings of all the classes member variables. see the special note below on the henv parameter for forcing this constructor to create a sql environment handle automatically, rather than needing to pass one in to the function. parameters henv
remarks it is strongly recommended that programs use the longer form of the constructor and allow the constructor to create the sql environment handle automatically, and manage the destruction of the handle. example
wxdbconnectinf *dbconnectinf; dbconnectinf = new wxdbconnectinf(0,"my_dsn", "my_user", "my_password"); ....the rest of the program delete dbconnectinf;see also wxdconnectinf::allochenv, wxdconnectinf::freehenv
wxdbconnectinf::~wxdbconnectinf~wxdbconnectinf() handles the default destruction of the instance of the class. if the long form of the wxdconnectinf was used, then this destructor also takes care of calling wxdconnectinf::freehenv to free the sql environment handle.
wxdbconnectinf::allochenvbool allochenv() allocates a sql environment handle that will be used to interface with an odbc datasource. remarks this function can be automatically called by the long from of the wxdbconnectinf constructor.
wxdbconnectinf::freehenvvoid freehenv() frees the sql environment handle being managed by the instance of this class. remarks if the sql environment handle was created using the long form of the wxdbconnectinf constructor, then the flag indicating that the henv should be destroyed when the classes destructor is called is reset to be false, so that any future handles created using the wxdbconnectinf::allochenv function must be manually released with a call to this function.
wxdbconnectinf::initializesimply initializes all member variables to a cleared state. called by the constructor automatically.
wxdbconnectinf::getauthstrconst wxchar * getauthstr() accessor function to return the password assigned for this class instance that will be used with the user id. synonymous with wxdbconnectinf::getpassword
wxdbconnectinf::getdefaultdirconst wxchar * getdefaultdir() accessor function to return the default directory in which the datasource's data table is stored. this directory is only used for file based datasources like dbase. ms-access does not require this to be set, as the path is set in the odbc administrator for ms-access.
wxdbconnectinf::getdescriptionconst wxchar * getdescription() accessor function to return the description assigned for this class instance. note: description is a future use item and is unused currently.
wxdbconnectinf::getdsnconst wxchar * getdsn() accessor function to return the datasource name assigned for this class instance.
wxdbconnectinf::getfiletypeconst wxchar * getfiletype() accessor function to return the filetype of the odbc datasource assigned for this class instance. note: filetype is a future use item and is unused currently.
wxdbconnectinf::gethenvconst henv gethenv() accessor function to return the sql environment handle being managed by this class instance.
wxdbconnectinf::getpasswordconst wxchar * getpassword() accessor function to return the password assigned for this class instance that will be used with the user id. synonymous with wxdbconnectinf::getauthstr
wxdbconnectinf::getuidconst wxchar * getuid() accessor function to return the user id assigned for this class instance.
wxdbconnectinf::getuseridconst wxchar * getuserid() accessor function to return the user id assigned for this class instance.
wxdbconnectinf::setauthstrsetauthstr(const wxstring &authstr) accessor function to assign the password for this class instance that will be used with the user id. synonymous with wxdbconnectinf::setpassword
wxdbconnectinf::setdefaultdirsetdefaultdir(const wxstring &defdir) accessor function to assign the default directory in which the datasource's data table is stored. this directory is only used for file based datasources like dbase. ms-access does not require this to be set, as the path is set in the odbc administrator for ms-access.
wxdbconnectinf::setdescriptionsetdescription(const wxstring &desc) accessor function to assign the description assigned for this class instance. note: description is a future use item and is unused currently.
wxdbconnectinf::setdsnsetdsn(const wxstring &dsn) accessor function to assign the datasource name for this class instance.
wxdbconnectinf::setfiletypesetfiletype(const wxstring &) accessor function to return the filetype of the odbc datasource assigned for this class instance. note: filetype is a future use item and is unused currently.
wxdbconnectinf::sethenvvoid sethenv(const henv henv) accessor function to set the sql environment handle for this class instance.
wxdbconnectinf::setpasswordsetpassword(const wxstring &password) accessor function to assign the password for this class instance that will be used with the user id. synonymous with wxdbconnectinf::setauthstr
wxdbconnectinf::setuidsetuid(const wxstring &uid) accessor function to set the user id for this class instance.
wxdbconnectinf::setuseridsetuserid(const wxstring &userid) accessor function to assign the user id for this class instance.
|