delphi-7

How to solve a closed dataset error when running an update query in Delphi 7?

我们两清 提交于 2019-12-11 05:59:16
问题 I keep getting an error in Delphi 7 with my application that uses the Microsoft Jet engine and a Microsoft Access (*.mdb) database. I am making the connection via a TADOQuery component. The error says 'Cannot perform this operation on a closed dataset' and happens only in one event handler when trying to execute an UPDATE query: frmHome.adoqryMain.SQL.Text := 'UPDATE Predictions SET Complete = True WHERE UID = "'+sUID+'"'; The event handler's code is as follows: procedure TfrmAdmin

Delphi 7 Soap WCF Service using basicHttpBinding

蓝咒 提交于 2019-12-11 04:35:07
问题 I added a basicHttpBinding to an existing Service I have in production in order to expose it for use in Delphi. When I try to use the WSDLImporter from Delphi 7 on the wsdl file, it doesn't work right. A section in the resulting tlb says // ************************************************************************ // // The following types, referred to in the WSDL document are not being represented // in this file. They are either aliases[@] of other types represented or were referred // to but

TADOStoredProc and SQL Server stored procedure with parameter as default value

十年热恋 提交于 2019-12-11 04:18:51
问题 I am working with Delphi 7 and SQL Server 2008. I have created a dummy table and dummy stored procedure as shown below. CREATE TABLE [dbo].[Persons] ( [P_ID] [int] IDENTITY(1,1) NOT NULL, [LastName] [varchar](255) NOT NULL ) CREATE PROCEDURE [dbo].[p_dummy_proc] @p_id int, @p_name VARCHAR(10) = 'dummy' -- donot pass anything from delphi and it should take 'dummy' AS BEGIN IF (@p_name is null) RAISERROR 123456 'why are you null' ELSE INSERT INTO dbo.persons(LastName) VALUES(@p_name) END I am

Delphi compiler options for Debugging

 ̄綄美尐妖づ 提交于 2019-12-11 04:15:06
问题 What effect do the options in the image below have on the finally binary? I first compiled my application with them enabled and the compiled binary file size was 7,606,272 bytes. Then I manually switched them off...and the size was unchanged. I also used these compiler switches (included in every file using a .inc file) to do the same thing: {$D-} // Remove "Debug information" {$L-} // Remove "Local symbols" {$Y-} // Remove "Reference info/Definitions only" {$C-} // Remove "Assertions" Same

Flicker when custom drawing on a double buffered TTreeView

眉间皱痕 提交于 2019-12-11 03:25:37
问题 When listening to the AdvancedCustomDraw event of a TTreeView event this way: if Stage = cdPrePaint then begin // modify some Sender.Canvas properties and let it draw itself end else if Stage = cdPostPaint then begin // draw 'something extra' using a separate TControlCanvas TControlCanvas.TextOut(SomeRect, 'Hello'); end; ... it seems that when I enable DoubleBuffered the control decides not to copy the 'something extra' to the offscreen buffer. This means that as long as I don't disturb the

Delphi 7 WriteProcessMemory

时光总嘲笑我的痴心妄想 提交于 2019-12-11 03:23:01
问题 This is my Working Code DriftMul:=99; WriteProcessMemory(HandleWindow, ptr($4E709C), @DriftMul, 2, Write); I want to Convert it without using a variable but it wont work Below is just an Example of what i want to do. WriteProcessMemory(HandleWindow, ptr($4E709C), ptr(99), 2, Write); Does anyone know a way to make this work with using a variable??? I am able to program in a few languages and every language i use their is a way to to do this. The reason i want to do this is because i am gonna

Login to web using TWebBrowser

故事扮演 提交于 2019-12-11 02:51:54
问题 How do I press the login button using TWebBrowser on the web page "https://v-tri.tri.co.id:8434/insms/dealer/en/loginin.do" using Delphi7 ? procedure TForm1.Open_webClick(Sender: TObject); begin webbrowser1.Navigate('v-tri.tri.co.id:8434/insms/dealer/en/loginin.do'); end; procedure TForm1.InputClick(Sender: TObject); begin WebBrowser1.OleObject.Document.GetElementByID('UserName').setAttribute('value', edit1.Text ); WebBrowser1.OleObject.Document.GetElementByID('PassWord').setAttribute('value'

Delphi TCollection - Possible to prevent changing items in run-time?

橙三吉。 提交于 2019-12-11 02:47:08
问题 Using delphi 7, I have a TCollection/TCollectionItem set of descendents. They are intended to be set up in Design-time only, and should never be modified in Run-time. How can I do this? Design-time should always allow whatever edits are needed, but in Run-time, I don't want to be able to Add, Remove, or Re-index any of the items in the collection. The properties of each of those items, yes, I do want them to be enabled. But changing the actual items around shall only be in design-time. 回答1:

Delphi XE3, ugly StringGrid's borders

…衆ロ難τιáo~ 提交于 2019-12-11 02:38:30
问题 Why StringGrid's borders are so unclear in XE3, comparing to Delphi7? How to fix that? 回答1: After Delphi 2010 all the Grids are themed. To disable the new theme on a grid you have to set the property DrawingStyle to gdsClassic in the objects inspector. 来源: https://stackoverflow.com/questions/12996363/delphi-xe3-ugly-stringgrids-borders

Sending email with Indy 9 with an embedded picture

蹲街弑〆低调 提交于 2019-12-11 02:35:57
问题 I am trying to add to a program of mine the capability of sending html email via SMTP with Indy 9. If the program only contains text (the text will be in Hebrew so I need to display it right to left, which means that I am using HTML statements), then the email is sent correctly. My problem lays with embedding pictures into the HTML stream. The HTML stream will use a command like <IMG SRC="cid:foo4atfoo1atbar.net" ALT="IETF logo"> Whilst the Indy 10 component TIdAttachmentFile has a