I have an ADOQuery qry1 which gets its ConnectionString programmatically. I need to add a Lookup field but, when I double-click the query, Delphi (7) complains there is no ConnectionString. So I need to code in the new field. I get as far as - I hope that's correct -
<code>...
I successfully create a new key and write a value to it. I cannot get to delete the values or the key itself. My code is
<code>
with TRegistry.Create do
try
Val := TStringList.Create;
RootKey := HKEY_LOCAL_MACHINE;
if OpenKey('SOFTWARE\VotAfr\', True) then
begin...
I'm playing around with copy-protection and want to try the following: Assuming I have an application MyApp.exe with a variable assigned the value of "ABCDE' somewhere inside the executable. How can I locate where this value is written in the file? Then, how can I write a new (same size) value...
I am experiencing two frustrating problems with an ADOQuery:
1) QRY1 uses a ConnectionString to Access db1. QRY2 must use a ConnectionString to another Access db2 in a different folder. However, QRY2 keeps telling me it cannot find db2 in the folder where db1 is located. To at least make the...
I am experiencing two frustrating problems with an ADOQuery:
1) QRY1 uses a ConnectionString to Access db1. QRY2 must use a ConnectionString to another Access db2 in a different folder. However, QRY2 keeps telling me it cannot find db2 in the folder where db1 is located. To at least make the...
Could someone please show me how to close my application if there has been no user input for a specified period of time? I want my program to terminate if the user did not click a key for say 10 minutes. I'm guessing I will need to use a TTimer so I can specify the time, together with...
I populate a DBGrid using a ClientDataSet, Provider and DataSource. I cant seem to get the DBGrid to sort when I click on a heading. Must I use an ADOQuery to do this?
Hannes
Is there a way to force an Access DB to close so I can erase the thing from my app? I have closed all ADOConnections, made all ADOTables and ADOQueries inactive, and closed all DataSets, however, the ldb file remains - I cannot erase the mdb file!
When creating a new DB, I use...
I have a form with a ListBox and 2 buttons. I declare a type
TName = class
CustName : string;
end;
var
MyFile : file of TName;
cName : TName;
Then use the following to add or display data:
procedure TForm1.btnAddClick(Sender: TObject);
begin
if Length(edtName.Text)<1 then Exit...
I'm using an Access DB in a voting program. One of the fields (VotedFor) relevant to a candidate is to record how many votes has been cast for that particular candidate. Problem is, if two or more voters vote for the same candidate at more or less the same time, only the first vote will be added...
With ShellAPI one can certainly run an Access application from Delphi but, is it possible to run a report inside that Access db from inside the Delphi application?
I have two existing but currently unrelated tables. Within a Delphi programme I have tried
ALTER TABLE tblFlights (Airplane TEXT(20) REFERENCES tblAircraft(Airplane));
and variations on this theme, but I keep getting a syntax error. Airplane is the key field in the table tblAircraft and I want...
I have two existing but currently unrelated tables. I have tried
ALTER TABLE tblFlights (Airplane TEXT(20) REFERENCES tblAircraft(Airplane));
and variations on this theme, but I keep getting a syntax error. Airplane is the key field in the table tblAircraft and I want to set up a 1-many...
I am using the SQL equivalent of IF in MS Access in a ADOQuery:
IIf(Flights.TOWeight>=5000,80,30) AS TAX FROM...
I believe this is for backward compatibility. How would one write this in 'pure' SQL, disregarding the need for backward compatibility?
Hannes
I have an ADOQuery populating a DBGrid. I'm trying to do
for n := 0 to qry1.RecordCount-1 //200 records
begin
Total := Total + qry1.FieldValues['TAX'];
Next;
end;
This simply adds the first record in the query 200 times!
Could someone pse tell me what I'm doing wrong?
Also, if I don't want...
Will appreciate advice on the following:
I populate a DBGrid from an ADODataSet and DataSource. The Access db has a Currency field. How does one display currency, including two decimals and trailing zeros, in the associated DBGrid column? The DisplayFormat option for the column has no effect...
On a subform in my app, I use an ADOQuery, ADODataSource and DBGrid to populate a Read-only DBGrid from an Access table. I then use an ADOCommand to execute an SQL statement to Update, Insert or Delete a record in the table. The data for this comes from an Edit (not dbEdit) box or two.
How do I...
I have one StringGrid, DataSource, ADOConnection and an ADOQuery on my form. I am trying to update an Access db:
adoQ.SQL.Text := 'SELECT PLAYERS.COUNTRY .... {abbreviated}
adoQ.Active := True;
Then
adoQ.SQL.Text := 'UPDATE GUESTHOUSES... {abbreviated}
adoQ.Active := True;
The error is...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.