delphi-2010

Syntax error with “Rand()” function in MySQL in Delphi

依然范特西╮ 提交于 2019-12-31 04:59:05
问题 I am trying to use the Rand() function within MySQL to select a random record but I am getting a syntax error in the Rand() LIMIT line qryCards.SQL.Add('SELECT * FROM tblCards WHERE Card_Rarity = "Epic"'); qryCards.Open; iCount := qryCards.RecordCount; qryCards.Close; qryCards.SQL.Clear; qryCards.SQL.Add('SELECT * FROM tblCards ORDER BY rand(' + IntToStr(iCount) + ') LIMIT 1'); qryCards.Open; ShowMessage(qryCards.FieldByName('Card_Name').AsString); 回答1: First off, you are not using RAND()

Problem with RadioGroup.ControlCount in Delphi 2010

独自空忆成欢 提交于 2019-12-31 03:44:47
问题 I'd like to set RadioButton properties in runtime in procedure InitRadioGroup(). It fails because RadioGroup.ControlCount is 0, although there are 3 RadioButtons in RadioGroup. What is wrong in D2010 RadioGroup? Same code works fine in Delphi 2007. procedure InitRadioGroup(RadioGroup: TRadioGroup); var i: integer; RadioButton: TRadioButton; begin for i := 0 to RadioGroup.ControlCount - 1 do begin RadioButton := (RadioGroup.Controls[i] as TRadioButton); RadioButton.ParentColor := False;

Launch an EXE with elevated privileges from a “normal” non-elevated one?

只谈情不闲聊 提交于 2019-12-30 14:15:47
问题 I have an EXE running with normal privileges, but there are cases (for example using VSS / volume shadow copy) where I need admin privileges (if I'm not mistaken) The idea is to put the code that needs extra privileges in a separate EXE and launch it as needed. It's something that I'll rarely need, but I still need to have it as a last resort option (this is to say that I'll rarely need to call it, maybe once/twice a day on average) My question is: How can I call an admin-elevated process

Binding a second instance of a form to a second instance of a data module?

久未见 提交于 2019-12-30 11:24:05
问题 I have a Form which has data aware controls bound to datasets in a datamodule. I need to create additional instances of both the form and datamodule in the same application. I deleted the global variable that was automatically created when the data module was first added to the project. To my delight, controls in the designer could still be bound to datasets in the data module without this global variable. I'm assuming the IDE is parsing the dfm of the datamodule so the designer can still

Why Delphi says 'cannot resolve unit name xxx'?

两盒软妹~` 提交于 2019-12-30 08:16:13
问题 I'm working with Delphi2010 Enterprise Update 4. When I'm opening my project in the IDE and displaying the mainform code, there are 2 unit names underline in red . xxx http://img268.imageshack.us/img268/6475/unitnameunresolved.png. I have verified that the path to the unit source is in the Library path and in the Browsing path . Surprisingly, when I'm doing a right-clicking on the unit and selecting Open file at cursor , it works (ie. delphi opens the right unit). Any idea about that ? 回答1:

Delphi 2010 Cryptography libraries [closed]

心不动则不痛 提交于 2019-12-30 04:47:08
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . can you recommend an open source Delphi crypto library that works with Delphi 2006, Delphi 2009 & Delphi 2010 Algorithms need : DES, MD5, SHA-1 回答1: Here is a short list of the libraries I have used both pre and post D2009: TPLockbox (I use an unofficial updated version. Although there is a recent official(?)

Random Indy ResponseCode = -1 / EIdSocketError Socket Error # 0 exceptions

守給你的承諾、 提交于 2019-12-29 07:52:12
问题 I have a delphi code that basically upload files to remote secure server using Indy 10.4.704 : IdHTTP := TIdHTTP.Create(nil); try TheCompressor := TIdCompressorZLib.Create(nil); TheSSL := TIdSSLIOHandlerSocketOpenSSL.Create(nil); with IdHTTP do begin HTTPOptions := [hoForceEncodeParams]; AllowCookies := True; HandleRedirects := True; ProtocolVersion := pv1_1; IOHandler := TheSSL; Compressor := TheCompressor; end; // with // Get upload resume offset try IdHttp.Head('https://www.domain.com/my

How to redirect binary gbak output to a Delphi stream?

前提是你 提交于 2019-12-28 12:44:08
问题 I want the Firebird backup tool gbak to write its output to a Delphi stream (with no intermediate file). There is a command line parameter to write to stdout rather than a file. I then use the Execute method in JEDI's JclSysUtils to launch gbak and process that output. It looks like this: procedure DoBackup; var LBackupAbortFlag: Boolean; LBackupStream: TStringStream; begin LBackupAbortFlag := False; LBackupStream := TStringStream.Create; try Execute('"C:\path to\gbak.exe" -b -t -v -user

What are the MSBuild project level properties for Delphi?

半世苍凉 提交于 2019-12-28 12:05:14
问题 The Delphi documentation for MSBuild says /property:name=value sets or overrides project-level properties, where name is the property name and value is the property value. Use a semicolon or a comma to separate multiple properties, or specify each property separately. /p is also acceptable. For example: /property:WarningLevel=2;OutputDir=bin\Debug I can't find a list of available properties, here's what I know so far: WarningLevel OutputDir (dcc32 -e equivalent) Config I'd like to get a

What are the MSBuild project level properties for Delphi?

こ雲淡風輕ζ 提交于 2019-12-28 12:05:07
问题 The Delphi documentation for MSBuild says /property:name=value sets or overrides project-level properties, where name is the property name and value is the property value. Use a semicolon or a comma to separate multiple properties, or specify each property separately. /p is also acceptable. For example: /property:WarningLevel=2;OutputDir=bin\Debug I can't find a list of available properties, here's what I know so far: WarningLevel OutputDir (dcc32 -e equivalent) Config I'd like to get a