Jump to content

Search the Community

Showing results for tags 'database'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start




Found 8 results

  1. I have inherited an app written in Pascal which I have never written before. I am barely competent with c sharp. I am using Embarcadero® Delphi 10.3 I have created my own program that gets data from a database and inserts data, but as far as the uber app goes I cannot figure out how text from edit boxes is being written to the database as soon as it is typed. For example I created a button that populates a edit box (the person I work with is tired of everybody entering a certain string incorrectly). When the user types in text it is automatically saved to the database, but in order for the text that is populated by clicking on the button to be saved the user has to click an edit button on a TBDNavigator, then press the button to populate the box, then press the post button. I have included the code snippet below, I couldn't see any instructions on how to format code. procedure TfDesignMaster.NoUPCButtonClick(Sender: TObject); begin DBEdit85.Text := 'NO UPC ON ITEM'; end; I know there must be a way to open edit and post but I can't find the datasource for it, there are so many associated with the project and I don't know the name of it. Does anyone know of a way to find the datasource that will allow me to add the code to edit and post? This is the only button that does this in the entire app or I would copy the code, and the other edit boxes are not pointing me anywhere. I am sure I am leaving out all sorts of information needed to answer this question, apologies and please let me know what information I can provide! Thanks!
  2. Hi all, A generic question. I'm deploying my apps with an embedded SQLite DB. Each time I compile/deploy, that existing on device DB file is overwritten by the default one. It's fine for development. But how do you actually proceed if you want to deploy an update? If a user has the app already with personal data, I don't want her/him to lose that data. Testing whether the DB already exists is not possible since it's deployed each time within the new binary. One way would be to have all the code to check whether the DB exists. If not, programmatically create it and fill it with sample data. If it does, just check its version and apply possible structure upgrades? But it feels like this would embark a lot of code that may not really be useful. How do you guys deploy news versions of your apps without overwriting exists DBs? I especially think about iOS and Android devices. Thanks for any light. Steve
  3. Guys, i'm having trouble using TBatchMove in my project. I'm migrating data from a Firebird database to a PostgreSQL database. I thought to retrive the data from de FB database without the primary key fields, because the destination tables in the PG database already have a primary key setted as serial, therefore the DB would create the indexes i needed. However, TBatchMove doesn't seem to work well with implicit values, everytime i try to execute the command, it tries to pull the primary key value from the closest field. When i added mappings to the component... Well, it started to try sending null values to the table. I am getting desperate, any solutions for this problem?
  4. hello every one ..............how to store a video location to database and restore to play it in tMediaPlayer ? thank you
  5. toufik

    The location of sqllite database ?

    good morning every one ^^ how is every one doing )) 1- i have fmx android app that s create sqllite db on create ,what's the location of db on the phone and is it const location ? (does not change for every other phones) 2- what's the proper way to copy it from that location to sd card (backup) ? thanks and take care
  6. PrimeMinister

    Problem with clearing ADO Tables

    Hey guys, so I'm having a problem with my ADO Tables. I have a button in my program that is meant to clear all tables in the database related to the program when clicked but whenever I click it, it gives errors. (no matter how many times I change my code) Could it be a problem with my Data Module or what? (I'm not sure cause my button which saves stuff to the database, works perfectly without a hitch) How could I alleviate this? Code of my data module: const scConnectionString = 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%pathtomdb%Racers.mdb;Mode=ReadWrite;Persist Security Info=False;'; var dmRacers: TdmRacers; implementation {%CLASSGROUP 'Vcl.Controls.TControl'} {$R *.dfm} procedure TdmRacers.DataModuleCreate(Sender: TObject); var path:string; begin path:=ExtractFilePath(ParamStr(0)); conToDB.ConnectionString := StringReplace(scConnectionString, '%pathtomdb%', path, []); conToDB.Connected:=True; tbl1660.Active := True; tblXKarts.Active := True; tblTwoPointOne.Active := True; tblMidB.Active := True; tblMidA.Active := True; tblLateModel.Active := True; tblSprints.Active := True; tblV8.Active := True; tblHeavyMetals.Active := True; tblHotrods.Active := True; tblPinkrods.Active := True; tblStockrods.Active := True; tblMinis.Active := True; tblDevelopment.Active := True; end; Code from the form: public { Public declarations } MyCmd:TADOCommand; procedure EmptyTable(tbl:TADOTable;tablename:string); procedure ResetActiveProp(tbl:TADOTable); end; var frmEntry: TfrmEntry; implementation {$R *.dfm} procedure TfrmEntry.ResetActiveProp(tbl: TADOTable); begin tbl.Active := True; end; procedure TfrmEntry.EmptyTable(tbl: TADOTable; tablename: string); var MyCmd: TADOCommand; begin tbl.Active := true; MyCmd.CommandText := 'Delete * from '+tablename; MyCmd.Execute; tbl.Active := false; end; procedure TfrmEntry.bmbClearClick(Sender: TObject); var i:integer; begin cbxGridSelect.ItemIndex:=-1; cbxGridSelect.Text:='Select a class'; edtRacerName.Clear; edtCarNumber.Clear; edtLicenseNum.Clear; i:=MessageDlg('Dialog cleared',mtInformation,[mbOK],0); end; procedure TfrmEntry.bmbClearDBClick(Sender: TObject); var i:integer; begin i:=MessageDlg('Are you sure you want to clear the Racers database? (all current data in the database will be lost.)',mtWarning,[mbOK,mbCancel],0); if i = mrOk then begin //clears entire database with dmRacers do begin EmptyTable(tbl1660,'tbl1660'); EmptyTable(tblXKarts,'tblXKarts'); EmptyTable(tblTwoPointOne,'tblTwoPointOnes'); EmptyTable(tblMidB,'tblMidB'); EmptyTable(tblMidA,'tblMidA'); EmptyTable(tblLateModel,'tblLateModels'); EmptyTable(tblSprints,'tblSprints'); EmptyTable(tblV8,'tblV8'); EmptyTable(tblHeavyMetals,'tblHeavyMetals'); EmptyTable(tblHotrods,'tblHotrods'); EmptyTable(tblPinkrods,'tblPinkrods'); EmptyTable(tblStockrods,'tblStockrods'); EmptyTable(tblMinis,'tblMinis'); EmptyTable(tblDevelopment,'tblDevelopment'); i:=MessageDlg('Database successfully cleared',mtInformation,[mbOk],0); //resets active property of tables ResetActiveProp(tbl1660); ResetActiveProp(tblXKarts); ResetActiveProp(tblTwoPointOne); ResetActiveProp(tblMidB); ResetActiveProp(tblMidA); ResetActiveProp(tblLateModel); ResetActiveProp(tblSprints); ResetActiveProp(tblV8); ResetActiveProp(tblHeavyMetals); ResetActiveProp(tblHotrods); ResetActiveProp(tblPinkrods); ResetActiveProp(tblStockrods); ResetActiveProp(tblMinis); ResetActiveProp(tblDevelopment); end; end else begin i:=MessageDlg('Clear aborted',mtInformation,[mbOk],0); end; end; Example of errors: Thanks in advance for the help! Kind Regards PrimeMinister
  7. Hello all, Getting "ibtogo64.dll not found in the path" when trying to run on any computer that does not have Interbase installed. I have been using Advantage local server and would like to move to iblite for testing and small desktop projects. I created a small test project using the sample data. I copied the compiled project and supporting files, including license file and data to a USB drive. Stopped the Interbase service and ran the project fine. Moved the USB drive to a different computer and got the error as soon as project ran. To make sure the running project was using the local DLL, I moved the USB back to the development computer and removed the DLL. Got the error, pasted back everything fine. What am I missing. Things I checked: Made sure DLL's are in same directory as exe Deployment files all checked except reg_ibtogo.txt using reg_iblite.txt reg_iblite.txt is in the license folder Interbase directory in same directory as exe Project is release version I ran the program from USB on laptop that has Interbase installed and service stopped and worked fine. any help would be appreciated, Gary
  8. OmahaMax

    OmniThread with Database

    The following code works perfectly with one task but fails to process one input variable with two tasks, two input variables with three tasks, etc. pipeline := Parallel .Pipeline .Stage( procedure(const input, output: IOmniBlockingCollection) var NewAmt, OldAmt: Currency; aDataObj: TDataObj; aValue: TOmniValue; aDm: TdmRetriever; begin aDm := TdmRetriever.Create(nil); aDm.SetUp(DataPath); aDataObj := TDataObj.Create('', 0, 0); try for aValue in input do // input is a stringlist of AcctNum begin s := aValue.AsString; MySL.Add(s); aDm.qRetrieverNew.SQL.Text := 'SELECT SUM(Amount) AS CurrYrAmt FROM TransBS' + #13 + 'WHERE (dDate <= ' + QuotedStr(ThruDateStr) + ') AND (AcctNum = ' + QuotedStr(s) + ')'; aDm.qRetrieverOld.SQL.Text := 'SELECT SUM(Amount) AS PrevYrAmt FROM TransBS' + #13 + 'WHERE (dDate <= ' + QuotedStr(PrevThruDateStr) + ') AND (AcctNum = ' + QuotedStr(s) + ')'; aDm.qRetrieverNew.Open; aDm.qRetrieverOld.Open; // Everything continues fine with one task; execution continues with first AcctNum // The first AcctNum is not processed below with two tasks // The first and second AcctNum are not processed below with three tasks if not VarIsNull(aDm.qRetrieverNew.FieldByName('CurrYrAmt').AsVariant) then NewAmt := aDm.qRetrieverNew.FieldByName('CurrYrAmt').AsCurrency else NewAmt := 0; if not VarIsNull(aDm.qRetrieverOld.FieldByName('PrevYrAmt').AsVariant) then OldAmt := aDm.qRetrieverOld.FieldByName('PrevYrAmt').AsCurrency else OldAmt := 0; MySL.Add(s + ', ' + CurrToStr(NewAmt) + ', ' + CurrToStr(OldAmt) ); aDataObj.fAcctNum := s; aDataObj.fCurrYr := NewAmt; aDataObj.fPrevYr := OldAmt; if not output.TryAdd(aDataObj) then break; end; aDm.SessionRetriever.CloseDatabase(aDm.dbRetriever); aDm.SessionRetriever.DropConnections; finally aDataObj.Free; aDm.Free; end; end ).NumTasks(aNumTasks) .Stage( The results, as logged to the MySL stringlist, are attached. I have no idea how to fix this. "aDm" is datamodule I create which contains the queries. I have placed the query openingss in a try-except and never received an error. I have placed query.isempty in a while loop since the query for AcctNum 1111 takes about 4 seconds. The answer is probably something simple, but I'm at a loss as to what I am doing wrong. Will appreciate any help. Log.txt