不知道的机器是怎么布置的,如果两台机器在一起的话可以采用SQL SERVER 中的STAND BY SERVER来实现这个功能,它实际上实现的是实时的双机热备份,如果主机出了问题的话可以把从机启动并把机器名改成和主机一样就可以代替主机运行。当然你可以采用推-拉定制方式复制数据库,不过这种一般是一对多的或是多机之间数据同你好用,比如你修改了A机,B机可以与A机同H步,修改了B机,B机可以与A机同步。如果你只是要复制某些表的某些字段的话最好是用触发器。
至于DTS我不是很喜欢用,所以在这里就不用推荐。
//Send the CRNO
m_pSocket->Send(OLE2A(pCRNO->bstrVal), 10);
m_pSocket->Receive(ReceiveBuffer, 2);
//Length of FieldName
sprintf((char *)SendBuffer, "%3d", LengthofFieldName);
m_pSocket->Send(SendBuffer, 3);
m_pSocket->Receive(ReceiveBuffer, 2);
//Send the FieldName
m_pSocket->Send(OLE2A(pFieldName->bstrVal), LengthofFieldName);
//Receive the FieldValue
memset(ReceiveBuffer, 0, 4097);
m_pSocket->Receive(ReceiveBuffer, 4096);
pFieldValue->bstrVal = SysAllocString(A2OLE(ReceiveBuffer));
/*
A2OLE allocates memory off the stack, which is
automatically freed when your method exits.
You need to use SysAllocString.
*/
参考文献:
1. 如何进行 Socket 编程,http://cgisss.533.net/learn/others/socket.htm
2. Active Template Library (ATL) Reference, MSDN, Microsoft
3. CSocket, Microsoft Foundation Class Library, MSDN, Microsoft
Data Synchronization Over Different Platforms Under Enterprise Security Policy
Geng Changyu1, Zhu Yunwen2, Hong Jiandong2, Ju Ti1
(1.Nanjing University of Post and Telecommunications, Nanjing Jiangsu, 210003; 2. Software Center, Motorola, China,Nanjing Jiangsu, 210029)
Abstract: This paper discusses methods of data synchronization over different platforms. Then it gives an example to illuminate the application of implementation of data synchronization over different platforms under enterprise security policy in the design of intranet automatic tools.
Key Words: Enterprise Security Policy, Intranet Automatic Tools, Socket Communication, Componential Programming