I am trying to run the following SQL statement:
"SELECT *, (IIF([Field]=TRUE,'StringValue1','StringValue2') AS [NewField] FROM [Table1] ORDER BY [NewField] ASC"
But this gives me an error "Parameter NewField has no default value". How can I solve it?
I am using Microsoft Access (MDB) database using Jet Engine from Delphi 7.
Thank yo...
I have a Delphi 2010 ADO program that has a DBGrid. Its dataset selects from an Access query. The query has a column defined as, CStr(Amount*UnitCount)+" "+Unit. The query works fine in Access. But the DBgrid refuses to show the values for this column
...
Hello,
I was wondering if there is a way to make an array which would have multiple types of data fields.
So far I was using aMyArray: array of array [0..1] of TPoint;
But now, it is not enough for me. I need to add 3 more elements to the existing 2 "Point" elements making it an array like aMyArray: array of (TPoint,TPoint,real,real,r...
I am working on a function that will give me a Kermit CRC value from a HEX string. I have a piece of code in DELPHI. I am a .NET developer and need the code in C#.
function CRC_16(cadena : string):word;
var
valuehex : word;
i: integer;
CRC : word;
Begin
CRC := 0;
for i := 1 to length(cadena) do
begin
valuehex :=...
hi all
I want to write an text editor and to assign the txt files to it. My problem is that I want to have only one instance running and when a new file is opened to send the filename to the first app that is already running... (I want to do this using mutex). Here is a small test
DPR looks like this
uses
Windows, Messages, SysUtils,...
I have a String that I needed access to the first character of, so I used stringname[1]. With the unicode support this no longer works. I get an error: [DCC Error] sndkey32.pas(420): E2010 Incompatible types: 'Char' and 'AnsiChar'
Example code:
//vkKeyScan from the windows unit
var
KeyString : String[20];
MKey : Word;
mkey:=vkKey...
hi, i have a windows service written in delphi
...
Hi,
I'm using Delphi 2010 to create a SOAP Server. The server is created as a ISAPI/NSAPI DLL. I then add an interface with some sample methods.
If I try and build this project I get this compiler error:
Building Project1.dproj (Debug
configuration) [DCC Fatal Error]
Unit1.pas(6): F2063 Could not compile
used unit 'msxml.p...
I'm using Zeos 7, and Delphi 2009 and want to check to see if a value is already in the database under a specific field before I post the data to the database.
Example: Field Keyword
Values of Cheese, Mouse, Trap
tblkeywordKEYWORD.Value = Cheese
What is wrong with the following? And is there a better way?
zQueryKeyword.SQL.Add('IF...
In Delphi you can pass class references around to compare the types of objects, and to instantiate them. Can you do the same with interface references being passed to a COM automation server?
For example, you can define a method taking a GUID parameter using the type library editor:
function ChildNodesOfType(NodeType: TGUID): IMBNode;...
As already discussed in Rtti data manipulation and consistency in Delphi 2010 a consistency between the original data and rtti values can be reached by accessing members by using a pair of TRttiField and an instance pointer. This would be very easy in case of a simple class with only basic member types (like e.g. integers or strings).
Bu...
I have a simple situation. A large organisation is using several different versions of some (desktop) application and each version has it's own database structure. There are about 200 offices and each office will have it's own version, which can be one of 7 different ones. The company wants to upgrade all applications to the latest versi...
I am integrating a system with 2 other applications, 1 using a Firebird database whilst the other BIS (using ADO). My delphi application uses Firebird. I need to read data from my database, insert it into both the BIS database and the other application firebird database. I have created seperate data modules for each. Sending data to the ...
Hey Everyone,
I've got what I'm hoping is a simple question. In the Delphi IDE, the path to the Delphi installation is specified as $(DELPHI). I am wondering if there is a way to create my own path indicators, such as $(MY_LIBRARY) or something similar. I thought $(DELPHI) was specified as an environment variable, but apparently not....
I'm writing an add-in for PowerPoint, and want to get the text from the current slide in the editing window. The following works, but only when the slide is selected in the slide selector pane.
xSelection := PowerPointApp.ActiveWindow.Selection;
if xSelection.Type = ppSelectionSlides then
begin
xSlide := xSelection.SlideRange.Item(1);...
Hi,
As you know, welcome page in RAD Studio shows a list of recent projects, and you can open each project by clicking on its name.
My problem is that if the project is located somewhere My Documents folder, then the link in welcome page does not work! It works fine for projects which are located outside My Documents, but no links to a...
I want a string type that is Unicode and that stores the string directly at the adress of the variable, as is the case of the (Ansi-only) ShortString type.
I mean, if I declare a S: ShortString and let S := 'My String', then, at @S, I will find the length of the string (as one byte, so the string cannot contain more than 255 characters...
Hi everyone,
I have a popup menu which contains several menu items and one of them can have child items. This entry has a little arrow on the right and when you hover your mouse over it, a sub-menu will open (without clicking). Now I want to populate this sub-menu at runtime, but only if the user actually opens it. If the user never ope...
I have a form and I've passed its handle to the OpenGL class to draw. I want to get keyboard commands from the user but it seems the procedures for getting the keys doesn't run (I've tested it). Although, I am using OnMouseDown with no problem at all.
Is there anything I am missing here? Anyone has a solution?
...
My team is maintaining a huge Client Server win32 Delphi application. It is a client/server application (Thick client) that uses DevArt (SDAC) components to connect to SQL Server.
The business logic is often "trapped" in Component's event handlers, anyway with some degree of refactoring it is doable to move the business logic in common ...