我在MS Access模块中创建了一个函数Calculate(A, B).
我还在MS Access中创建了一个Query来使用这个函数,让我们说:
UPDATE aTable
SET aField = Calculate(bField, cField)
Run Code Online (Sandbox Code Playgroud)
我怎样才能调用查询,因为我尝试使用:adoConnection.Execute,adoTable,adoQuery,adoCommand,和StoredProcedure,所有的消息拒绝
未定义的函数在表达式中计算.
先感谢您.
我正在使用Delphi Pascal开发一个小工具来打开一个XLSX文件,并在其上写一个单元格.它在使用Office 2013和Office 365的计算机上的行为有所不同.
这是代码:
var
ExcelApp: OleVariant;
anExcelFileName: String;
begin
try
ExcelApp := CreateOleObject('Excel.Application');
anExcelFileName := 'D:\sample.xlsx';
ExcelApp.Workbooks.Open(anExcelFileName);
ExcelApp.Visible := True;
ExcelApp.Workbooks[1].Sheets[1].Range['A1'].Value := 'HELLO';
except
on E: Exception do
showMessage('Error on something: ' + E.Message);
end;
end;
Run Code Online (Sandbox Code Playgroud)
在Office 2013中,代码将访问驱动器D中的文件sample.xlsx,打开它,并在单元格A1中写入HELLO.
在Office 365中,代码将打开两个文件.首先,它将打开sample.xlsx并打开一个新的空白工作簿,并在新的空白工作簿中编写HELLO.
如何在办公室365中获得旧行为?
我尝试使用 ShellExecute 运行应用程序。它运行了,但没有显示(我可以在 TaskManager 中看到实例)。
ShellExecute(0, PChar('open'), PChar(ExtractFileName(edExePath.Text)),
PChar(theParameter), PChar(theFolder), WS_MAXIMIZE);
Run Code Online (Sandbox Code Playgroud)
我该怎么做才能使应用程序以最大窗口大小启动?
I need to swap character dot with comma and vice versa simultaneously.
function TformMain.SwapString(input, fromSymbol, toSymbol: String): String;
begin
Result := AnsiReplaceStr(input, fromSymbol, '_'); //100,200_00
Result := AnsiReplaceStr(Result, toSymbol, fromSymbol); //100.200_00
Result := AnsiReplaceStr(Result, '_', toSymbol); //100.200,00
end;
Run Code Online (Sandbox Code Playgroud)
How to do this using TRegEx in Delphi Rio?