#ifndef __GLOBAL_20160918__
#define __GLOBAL_20160918__

#pragma once

#ifdef USE_ODBC
#define DB_SS_CONN_WITH_PORT		_T("driver={SQL Server};Server=%s,%d;database=%s;uid=%s;pwd=%s")
#define DB_SS_CONN_WITHOUT_PORT		_T("driver={SQL Server};Server=%s;database=%s;uid=%s;pwd=%s")
#define DB_SS_CONN_WITHOUT_PORT2	_T("driver={SQL Server};Server=%s;database=%d;uid=%s;pwd=%s")
#define DB_SW_CONN_WITH_PORT		_T("Driver={SQL Server};Server=%s,%d;Database=%s;Trusted_Connection=yes;")
#define DB_SW_CONN_WITHOUT_PORT		_T("Driver={SQL Server};Server=%s;Database=%s;Trusted_Connection=yes;")
#define DB_SW_CONN_WITHOUT_PORT2	_T("Driver={SQL Server};Server=%s;Database=%d;Trusted_Connection=yes;")
#else
#define DB_SS_CONN_WITH_PORT		_T("Provider=sqloledb;Data Source=%s,%ld;Initial Catalog=%s;User Id=%s;Password=%s; ")
#define DB_SS_CONN_WITHOUT_PORT		_T("Provider=sqloledb;Data Source=%s;Initial Catalog=%s;User Id=%s;Password=%s; ")
#define DB_SS_CONN_WITHOUT_PORT2	_T("Provider=sqloledb;Data Source=%s,%ld;Initial Catalog=%s;User Id=%s;Password=%s; ")
#define DB_SW_CONN_WITH_PORT		_T("Provider=sqloledb;Data Source=%s;Initial Catalog=%s;User Id=%s;Password=%s; ")
#define DB_SW_CONN_WITHOUT_PORT		_T("Provider=sqloledb;Data Source=%s;Initial Catalog=%s;Trusted_Connection=yes;")
#define DB_SW_CONN_WITHOUT_PORT2	_T("Provider=sqloledb;Data Source=%s;Initial Catalog=%d;Trusted_Connection=yes;")
#endif
namespace Global
{
	extern TCHAR g_szModulePath[MAX_PATH];			// 软件目录;
	extern TCHAR g_szModuleFileName[MAX_PATH];		// 软件名称;
	extern TCHAR g_szConnectString[MAX_PATH];		// DB连接串;
	// 服务器信息;
	extern TCHAR g_szDBSource[MAX_PATH];			// 数据库源(服务所在IP或计算机名);
	extern TCHAR g_szDBSourcePort[MAX_PATH];		// 数据库源端口;
	extern DWORD g_dwDBServerPort;					// 数据库源端口;
	extern TCHAR g_szDBAccount[MAX_PATH];			// 数据库登录用户;
	extern TCHAR g_szDBPassWord[MAX_PATH];			// 数据库登录密码;
	extern TCHAR g_szDBName[MAX_PATH];				// 数据库名称;	
	extern DWORD g_dwDBPoolMaxCount;				// 数据库连接池最大对象数;
	extern DWORD g_dwDBPoolDef;						// 数据库连接池默认对象数;
	extern int GetIniInfo(const TCHAR *szPath = NULL, const TCHAR *szIniName = NULL);
	extern void WriteTextLog(const TCHAR *format, ...);
};

#endif