CString GetConnectIP() { CString bstr = (char*)theConnection->GetConnectionString(); int nl = bstr.Find("Data Source=") + strlen("Data Source="); int nr = bstr.Find(";", nl); return bstr.Mid(nl, nr-nl); }