我现在在做PPC的数据库开发,需要将模拟器PPC的SQLCE与服务器上的SQL2000同步,RDA中有三个函数Submit,Pull,Push.
在Submit时是成功的,但在Pull时就出现了问题。
如下
ERROR 1 of 2
Description:'SQL Server CE encountered problems in opening the SQL Server CE database.[,,,Database name,,]'
NUMBER:80004005
NATIVE_ERROR:28559
SOURCE:'Microsoft SQL Server 2000 Windows CE Edition'
ERROR 2of 2
Description:'The database file cannot be found.CHeck the path to the database.[,,,File name,,]'
NUMBER:80004005
NATIVE_ERROR:25046
我相信一定也有人碰到象我这样的问题了,求知道的人帮点忙。
这是代码
ISSCERDA* pCERDA = NULL;
BSTR bStr = NULL;
BSTR bConnectStr = NULL;
BSTR bQueryStr = NULL;
BSTR bLocalConnectStr = NULL;
BSTR bLocalTableName = NULL;
BSTR bErrorTableName = NULL;
RDA_TRACKOPTION trackOption = TRACKINGOFF;
SYSTEMTIME systemtime; // 系统时间
double timeTotal; // 总共消耗的时间
__int64 timeStart = 0; // 开始操作时的时间
__int64 timeStop; // 结束操作时的时间
WCHAR wszBuffer[512];
CDlgPull dlgPull;
if (dlgPull.DoModal())
{
//得到pCERDA接口
HRESULT hr = CoCreateInstance(CLSID_RemoteDataAccess, NULL, CLSCTX_INPROC_SERVER, IID_ISSCERDA, (LPVOID *)&pCERDA);
ASSERT(hr == S_OK);
ASSERT(pCERDA != NULL);
//1、设置Internet URL
bStr = SysAllocString(dlgPull.m_internetURL);
pCERDA->put_InternetURL(bStr);
SysFreeString(bStr);
//2、设置Internet userName
bStr = SysAllocString(dlgPull.m_internetUsername);
pCERDA->put_InternetLogin(bStr);
SysFreeString(bStr);
//3、设置Internet password
bStr = SysAllocString(dlgPull.m_internetPassword);
pCERDA->put_InternetPassword(bStr);
SysFreeString(bStr);
//4、得到跟踪类型
if (dlgPull.m_tracking == L"TRACKINGON")
{
trackOption = TRACKINGON;
}else if (dlgPull.m_tracking == L"TRACKINGOFF")
{
trackOption = TRACKINGOFF;
}else if (dlgPull.m_tracking == L"TRACKINGON_INDEXES")
{
trackOption = TRACKINGON_INDEXES;
}else if(dlgPull.m_tracking == L"TRACKINGOFF_INDEXES")
{
trackOption = TRACKINGOFF_INDEXES;
}else
{
trackOption = TRACKINGOFF;
}
//5、设置错误表名
bErrorTableName = SysAllocString(dlgPull.m_errorTableName);
//6、设置服务器连接串
bConnectStr = SysAllocString(dlgPull.m_connectStr);
//7、设置本地数据库连接串
bLocalConnectStr = SysAllocString(dlgPull.m_localConnectStr);
pCERDA->put_LocalConnectionString(bLocalConnectStr);
SysFreeString(bStr);
//8、设置本地表名
bLocalTableName = SysAllocString(dlgPull.m_localTableName);
//9、设置查询的SQL语句
bQueryStr = SysAllocString(dlgPull.m_queryStr);
//记录获取服务器数据前的时间
GetLocalTime(&systemtime);
SystemTimeToFileTime(&systemtime, (FILETIME*)&timeStart);
//获取服务器数据
hr = pCERDA->Pull(bLocalTableName,
bQueryStr,
bConnectStr,
trackOption,
bErrorTableName);
SysFreeString(bLocalTableName);
SysFreeString(bQueryStr);
SysFreeString(bConnectStr);
SysFreeString(bErrorTableName);
if (SUCCEEDED(hr))
{
//记录获取服务器数据后的时间
GetLocalTime(&systemtime);
SystemTimeToFileTime(&systemtime, (FILETIME*)&timeStop);
//记录获取服务器数据的总时间
timeTotal = ((double)(timeStop - timeStart) / 10000000);
swprintf(wszBuffer, _T("从服务器获取数据成功\r\n\r\总共消耗 = %8.3f秒"), timeTotal);
AfxMessageBox(wszBuffer);
}
else
{
//显示获取服务器数据错误
ISSCEErrors *pISSCEErrors = NULL;
if(SUCCEEDED(hr = pCERDA->get_ErrorRecords(&pISSCEErrors)))
{
ShowErrors(pISSCEErrors);
pISSCEErrors->Release();
}
}
//释放远程访问接口
pCERDA->Release();
}
我还是有问题啊!!!!
pull没有成功过
老是报“Internal error: HTTP header information is either corrupted or missing in the transport message. It could be a network transmission error or an IIS problem.”这个错,搞不懂了
大哥你是怎么解决的啊,我也遇到了Pull,
ERROR 1 of 2
Description: 'SQL Server CE encountered problems in opening the SQL Server CE database.[,,,Database name,,] '
NUMBER:80004005
NATIVE_ERROR:28559
我是在wince环境下测试也是这样,不知道怎么办,顶一下