这是什么语言写的?解决方法
这是什么语言写的?
// MSSQLServer 数据库连接
local strServer = "10.0.0.11"; // 报告所在服务器
local strDBName = "opp"; // 数据库
local strUserName = "opp"; // 用户名
local strPwd = "opp"; // 密码
local bShowExcel = true; // 显示Excel?
wc <- CWaitCursor(); // 开始干活. 显示漏沙光标( 表示系统忙ing... )
connDB <- ADOConnection( ); // 创建ADO连接
dsCreateData <- ADODataset();// 创建记录集
dsReport <- ADODataset(); // 创建记录集
local bRet;
{ // 准备
dllKernel32 <- CWin32Dll( "Kernel32.dll" ); // 载入DLL
function WaitExcelFinished( iTimeOut /*超时秒*/ )
{// 函数 等待所有Excel执行结束
local iCounter = iTimeOut;
local iExcelPID = CSYSGlobal.GetPIDByName( "excel.exe" );
while( iExcelPID > 0 )
{
dllKernel32.Sleep( 1000 ); // 等待1000ms
if( iCounter == 0 )
{// 等待太长了. 估计是遇到异常. 直接Kill
CSYSGlobal.KillProcessByPID( iExcelPID );
iExcelPID = CSYSGlobal.GetPIDByName( "excel.exe" ); // 可能还有别的Excel?
iCounter = iTimeOut;
}
iExcelPID = CSYSGlobal.GetPIDByName( "excel.exe" );
iCounter --;
}
}
// end 函数 等待所有Excel执行结束
function ExecSql( connDB, strSql )
{ // 执行SQL
local cmd = ADOSQLCommand( connDB, strSql, adCmdText );
return cmd.Execute();
}
// end 执行SQL
// 连接数据库
bRet = connDB.Open( DB_DRIVER_TYPE_MSSQL, strServer, strDBName, strUserName, strPwd, 30 );
if( !bRet )
{
print( "%s", ADOGetLastErrorText() );
return;
}
}
// end 准备
{// 取出要处理的记录行
{ // 取出要生成数据的报告
dsCreateData.AttachToDB( connDB );
bRet = dsCreateData.Open( format( "select * from t_gtms_report_splitplan where splitStatus = 0" ), openBatch );
if( !bRet )
{
print( "%s", ADOGetLastErrorText() );
}
}
// end 取出要生成数据的报告
{ // 取出要分离的报告
dsReport.AttachToDB( connDB );
bRet = dsReport.Open( format( "select top 10 * from t_gtms_report_uploadInfo where uploadStatus = 1" ), openBatch );
if( !bRet )
{
print( "%s", ADOGetLastErrorText() );
}
}
// end 取出要分离的报告
if( dsCreateData.GetRecordCount( ) <= 0