delphi-2010

Connecting to remote my Sql shows me access denied for user azerty@41.175.10.32 ( Using Password : Yes )

北慕城南 提交于 2019-12-02 04:15:45
问题 Everything worked fine, When I configure the TMySqlConnection Driver to connect on the Local computer using WAMP local server, but when trying to configure the driver to connect to a remote MySQL server, I got an error. aceess denied for user myuserna_me@41.175.10.32 ( Using password: yes) How to fix the problem and force the host address to be the server's IP in which my SQL database is hosted. credentials: HostName : mydomain-cdn.net PassWord : Hk*HjBc+SwXS Username : myusername Database :

Delphi: RTTI for indexed properties in 2010?

…衆ロ難τιáo~ 提交于 2019-12-02 00:01:02
问题 Please forgive the verbosity of the following code example. Using Delphi 2009, I created the two classes TOtherClass and TMyClass: TOtherClass = class(TObject) public FData: string; end; TMyClass = class(TObject) private FIndxPropList: Array of TOtherClass; function GetIndxProp(Index: Integer): TOtherClass; procedure SetIndxProp(Index: Integer; Value: TOtherClass); public property IndxProp[Index: Integer]: TOtherClass read GetIndxProp write SetIndxProp; end; with access specifiers implemented

How do I avoid expanding folded regions when I invoke the code formatter?

喜夏-厌秋 提交于 2019-12-01 23:02:22
As you know, Delphi 2010 has built-in code formatting. However, formatting unfolds all folded code blocks. Any ideas how to fix it? This "feature" is particularly annoying for me and I was really astonished when I couldn't find any mention of this problem. What I've tried: Searching for alternative, e.g., GExperts have code formatter plugin, but it also unfolds code blocks. Tried to write a macro for GExperts: Ctrl+D(format code) -> various code folding/unfolding shortcuts, but couldn't manage to make it respect all folded/unfolded block structures. Write a CnWizards script, but could't find a

How can I use Tidhttp to make a Get request with a parameter called xml?

血红的双手。 提交于 2019-12-01 22:17:33
I've been successfully using Delphi 2010 to make an http get requests, but for one service that expects a parameter called 'xml' the request fails with a 'HTTP/1.1 400 Bad Request' error. I notice that calling the same service and omitting the 'xml' parameter works. I have tried the following with no success: HttpGet('http://localhost/Service/Messaging.svc/SendReports/PDF?xml=<?xml version="1.0"?><email><message><to>email@internal.com</to><from>from@internal.com</from></message></email>&id=42&profile=A1'); ... function TReportingFrame.HttpGet(const url: string): string; var responseStream :

Getting an IStream from an OleVariant

寵の児 提交于 2019-12-01 21:56:44
I am using Delphi along with WinHTTP to do an HTTP request to download some files from the internet, and I can do the request but I don't know how to get the IStream from the OleVariant that is returned from ResponseStream . I have spent a lot of time googling but I can't figure out how to do it. Here is what I have tried: var req: IWinHTTPRequest; instream: IStream; begin req := CoWinHTTPRequest.Create; req.Open('GET', 'http://google.com', false); req.Send(''); if req.Status <> 200 then begin ShowMessage('failure'#10 + req.StatusText); FreeAndNil(req); Application.Terminate; end; instream :=

File size calculation, Int64, and differences between 32bit and 64bit

房东的猫 提交于 2019-12-01 21:29:56
I had problems with the following code: var FileSize : Int64; ... FileSize := Info.nFileSizeLow or (Info.nFileSizeHigh shl 32); I expected it to work because of the Int64 type of the left side of the assignment. But it does not. The partial calculation containing the shl seems to produce an overflow. So I changed it to: FileSize := Info.nFileSizeLow or (Int64 (Info.nFileSizeHigh) shl 32); which works on my 32 bit operating system, but does not work on Vista 64 bit! Finally, FileSize := Info.nFileSizeHigh; FileSize := FileSize shl 32; FileSize := Info.nFileSizeLow or FileSize; works on both

Creating a UDF for MySQL in Delphi

天大地大妈咪最大 提交于 2019-12-01 21:20:36
How do I create a UDF for MySQL using Delphi? Does anyone have any code templates? I want the code template to be integrated in Delphi versions(2007 and upper), so I need these templates to be usable with and without Unicode support. For starters, Google reveals: documentation a forum thread an example You need to create a DLL with a few exported functions, as documented. 来源: https://stackoverflow.com/questions/5894258/creating-a-udf-for-mysql-in-delphi

Delphi 2010 and Dbexpress deploy

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 17:43:37
问题 How on Earth to deploy a Delphi 2009 /2010 app that connects to a remote mysql using dbexpress? What files to include? Thanks 回答1: You need dbexpress driver for MySQL (dbxmys.dll), and MySQL client library which is a single DLL (libmySQL.dll). In Delphi 2009, there is a bug (I'm not sure if it is fixed by any update), which makes you deploy dbxdrivers.ini and dbxconnections.ini files with your application too; otherwise you will get a runtime error on the target machine. There are a few

How to discard mouse click in TDbGrid.OnColumnMoved

情到浓时终转凉″ 提交于 2019-12-01 17:16:21
In a TDbGrid.OnColumnMoved event handler, I adjust some column headings colors. I also use the grid's OnTitleClicked event to pop-up a (sort column) menu. Unfortunately, after the user drags a column and OnColumnMoved is finished, the VCL calls OnTitleClicked . This means my sort-order pop-up appears after column dragging. Is there a way in OnColumnMoved I can clear the mouse event queue so that OnTitleClicked doesn't get called? This thread has this code, but I don't have a Msg in OnTitleClicked . while PeekMessage(Msg, 0, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE or PM_NOYIELD) do; (If there's

Loading RTF text from database into TRichEdit

心已入冬 提交于 2019-12-01 16:44:35
问题 I am currently in the process of migrating our software solution from Delphi 7 to 2010. Mostly the changes have been simple and there are only a small amount of hurdles left to go. On a form we use a TRichEdit which displayed rtf text grabbed from a blob field in a MSSQL db. This is how it worked in Delphi 7: //Get RTF text from Blob field using TADOQuery rtfStream := sql.CreateBlobStream(sql.FieldByName('rtftext'), BmRead) as TMemoryStream; //Load into TRichEdit RichEdit.PlainText := False;