Jump to content

Damon

Members
  • Content Count

    22
  • Joined

  • Last visited

Everything posted by Damon

  1. My goal is to simply open a basic excel sheet with a few columns, (ID, Name, Color) and then load it to a Tstringgrid so i can run some validation on it and import it (or update records) in a MySql db. My issue is I cannot seem to get a connection and it is due to the provider being 64 bit and the delphi app being 32 bit. LAdoQueryExcel.ConnectionString:= 'Provider=Microsoft.ACE.OLEDB.12.0;Data Source='+opendialog1.FileName+';Extended Properties="Excel 12.0 Xml;HDR=YES;IMEX=1"'; LAdoQueryExcel.SQL.Add('SELECT * FROM [Sheet1$]'); LAdoQueryExcel.Open; No matter what, i get "provider not found". I tried to install the 32 bit access runtime but it will not let me unless i uninstall office entirely. There must be a way around this. I can't control if people have 32 or 64 bit office installed. TIA for your input. If there's a different approach all together, then by all means - bring it. I'm not married to the ADO connection it was just what i thought was the simplest way to grab from an excel sheet.
  2. I can't be the only one going crazy with these problems. Laptop has a high resolution screen running 150% dpi, when at home office I use an external monitor as a second screen (extended desktop) at 100% dpi, when in the work office i'm just using the laptop. At home i put the ide on the second monitor. The ide does more wonky things than i can count. For example, it moves non-visual controls seemingly randomly which ones to places off screen. Font size in the code window changes/doesn't match dpi of monitor, along with certain objects/fonts in the design time areas. Some non-visual components are even lost at this point since they are so far off the screen i'm assuming. I have to search for them in the object inspector. On the multiple monitor front as well, why does the ide insist on always moving the debug application and itself back to monitor 1 every time you run? Then on exit of the application the ide goes back to the monitor you had it on, but it's not the same size. In fact it never remembers what size it was I don't think. It's very annoying and over hours of coding and debugging it's honestly a huge waste of time constantly resizing windows. 10.4 was less buggy with this behavior but still always moved apps to monitor 1.
  3. This is vcl. The project was started in 10.x but i have not opened it backwards. The pc is entirely new anyway. Only 11 is installed on it. So to follow up - the video i made yesterday showed the problem only on the laptop while at the office. I am home this morning and open Delphi and it goes to my add on monitor (100% dpi) and it now behaves fine. I moved the components and saved them and they stayed. I am wondering if there is a problem between the saved desktop settings and the ide when a monitor is not there along with the dpi problems. I unchecked the snap/scale grid with dpi setting and the ide is at least behaving better now when switching from maximized to windowed. Maybe i need to setup another desktop and switch between them... but remembering to do that every day is unlikely.
  4. Here's another issue that seems to be only high dpi occuring.
  5. First, yes, i have saved a layout and am aware of the setting. As a developer i've been struggling with high dpi for some number of years now with my own applications. 4k displays have been out a long time. I have never made the ide "non dpi aware" as suggested and never had these problems. It seems the dpi "additions" they have may in 11 vs 10.x have caused these issues. I used the exact same setup and while the failure to stay on the source monitor was still a thing, these weird form changes and glitches were not present.
  6. Happened to me this morning for the first time. Close/open the IDE resolved.
  7. Making me crazy. I build grid at runtime based on a db record with col and row counts. I display and populate strings with data for cells from detail table data. When the grid is shown (pagecontrol tab is active) i want to programatically select the row that matches some data (id for a record) i know what col and row this is but when i try to set col and row it says out of bounds which is a lie. I thought it maybe because of fixed row and col, but if i set col-1 and row-1 the result is the same. 😞 What am I missing? This is to build the grid: procedure Tmain.buildrackClick(Sender: TObject); var i, k, c, r, j, box, rb, cb : Integer; begin //showmessage('draw grid'); stringgrid1.ColCount := ddata.rackclientdataset.fieldbyname('c').asinteger+1; stringgrid1.RowCount := ddata.rackclientdataset.fieldbyname('r').asinteger+1; setgridrow := 0; setgridcol := 0; j := 0; box := 0; K := 0; with StringGrid1 do for J:= 0 to RowCount - 1 do for I := 0 to ColCount - 1 do begin K := K + 1; if (i = 0) or (j = 0) then begin rb := 0; end else begin box := box + 1; ddata.tubclientdataset.locate('Rackid;Tubid',vararrayof([listbox1.items[listbox1.ItemIndex],box]),[]); if ddata.tubclientdataset.fieldbyname('id').asstring = '' then Cells[I,J] := 'Bin '+IntToStr(box) else begin Cells[I,J] := 'Bin '+IntToStr(box)+' '+ddata.tubclientdataset.fieldbyname('id').asstring; if (dbedit17.text = listbox1.items[listbox1.ItemIndex]) and (dbedit18.text = inttostr(box)) then begin setgridrow :=J; setgridcol:=I; //showmessage('cell is row '+inttostr(j)+' col '+inttostr(i)); end; end; end; end; with StringGrid1 do for r := 1 to RowCount - 1 do begin Cells[0,r] := 'Row '+inttostr(r); end; with StringGrid1 do for c := 1 to ColCount - 1 do begin Cells[c,0] := 'Column '+inttostr(c); end; stringgrid1.defaultcolwidth := trunc((stringgrid1.Width-56)/stringgrid1.colcount); stringgrid1.defaultrowheight := trunc((stringgrid1.height-45)/stringgrid1.rowcount); stringgrid1.ColWidths[0] := 56; end; Then this is to select the cell and it will not work! Fails when trying to set col value. Can see valid grid cell on screen at time. Doesn't make sense. Vars have correct data. if (setgridcol <> 0) and (setgridrow <> 0) then begin //stringgrid1.refresh; showmessage(inttostr(setgridcol)+' is col '+inttostr(setgridrow)+' is row - try to set cell selected.'); //stringgrid1.SetFocus; showmessage('grid focused'); stringgrid1.col := setgridcol; showmessage('col set'); stringgrid1.row := setgridrow; showmessage('row set'); end;
  8. Damon

    Tstringgrid grid index out of bounds

    Remy, this works. All i did was comment out the .col and .row assignment and put in this code. It selects the cell and completes the ondrawcell correctly to color the selected cell. I guess the other methods just does not work as intended. ?
  9. Damon

    Tstringgrid grid index out of bounds

    David, you are in fact correct. I am terrible at using the debugger even though i have been using delphi since 2.0. However, my code, albeit quite messy compared to Remy's worked fine and produced exactly the same results. That piece of code was written by me some 20 years ago for a project i am porting up from D5 and the BDE to D10.x and an SQL backend. I honestly don't even remember why the variables i decided to use were so cryptic, but they must have made sense to me at the time. There is no other bug causing it. I have traced every step to the error in my code, but i do take to heart your advice about debugging and my poor knowledge of the use of it.
  10. Damon

    Tstringgrid grid index out of bounds

    Remy, thank you. Your code is much cleaner than mine. Result is the same however. Grid index out of bounds when attempting to assign the col and row to make the desired cell selected (and thus highlighted in the draw routine). I'm confused as the variables show what seem to be valid numbers. For example, a grid with 1 fixed row and 1 fixed col, with 9 string rows and 1 string col - the variables setgridcol is 1 and setgrid row is 2 should (i would think) select the 2nd cell in the grid. Row, 2, Column 1 in my attached image. But it throws the error. Thank you for you assistance, Damon StringGrid1.Col := setgridcol; ShowMessage('col set'); StringGrid1.Row := setgridrow; ShowMessage('row set');
  11. I have used both firedac and ado connections to connect to old paradox files to read the data and process to a mysql server. I have gotten this working fin on my development machine. When installing and running on a test machine i get the error: external table is not in the expected format. This happens with both connection types and I cannot figure out what is missing for different from the text machines. Any suggestions?
  12. Damon

    External table not in the expected format

    This is the program you were helping me with before. I have the paradox tables on the target that are the same as the dev computer. Charset is same. I am using the MS standard odbc that comes with windows. This works on my dev computer both with firedac and ado connections, but both fail on the target. No BDE on target. The odbc is configured on both computers the same. MySQL is installed on both, but part works fine. It is the paradox file connection that is the problem. Sample data files here: https://degei.com/D5/D4to5MigrationTool/Degei4.zip Messagedlg('Load data process. Starting data migration...',mtinformation,[mbok],0); adoconnection1.Connected := true; //START TABLE PROCESSING... showmessage('Connection is done. Start query.'); countlabel.Caption := 'Working on ACTIVITY.DB table.'; countlabel.Update; adoquery1.SQL.Text := 'select count(*) from activity.db'; adoquery1.open; //---------------------------OPEN QUERY FAILS WITH "external table not in expected format" error. IT DOES THE SAME IF I USE FIREDAC CONNECTION. The connections works, so the odbc config is working. adoquery1.Active := true; showmessage('query active with '+inttostr(adoquery1.fields[0].asinteger)+' records'); progressbar1.Min := 1; if adoquery1.fields[0].asinteger > 0 then progressbar1.Max := adoquery1.fields[0].asinteger;
  13. I have followed this instruction: https://blogs.embarcadero.com/firedac-odbc-for-paradox-and-dbase-tables/ But it does not work. When trying to make the TFDTable active the error occurs: [FireDAC][Phys][ODBC][Microsoft][ODBC Paradox Driver] Unexpected error from external database driver (11265).. If it matters, I am writing a program to convert my old Delphi 5 BDE Paradox tables to MySQL as part of an application upgrade. I know this is a Delphi FireDAC problem, because the ODBC that was created to connect to the Paradox files works just fine with Crystal Reports. Anyone have any solutions?
  14. Damon

    Firedac connection to paradox via odbc

    I started from scratch with the FDconnection and finally got it to work i think. Thanks for sticking with me. There are some architecture errors when using FDTable, but not with FDQuery so i will just use that. The FireDAC seems very picky with these old paradox tables. But thanks again for all your help! Now i can start writing the import to MySql.
  15. Damon

    Firedac connection to paradox via odbc

    Still unsuccessful at this. I have tried both versions of the microsoft driver that are on windows with no luck. Every time the connection establishes fine, the FDTable will read the odbc and find all of the tables in the folder. Once I try to set the FDTable to active i get the error. The driver will not read the data. This is a FIREDAC config (my fault) or operational problem - as I can use the same ODBC that I created and it works just fine in Crystal reports as shown in the screen shots. I am completely baffled. Same error (11265) when trying to activate an FDQuery also. Damon
  16. Damon

    Firedac connection to paradox via odbc

    @emailx45 where does the connectionname property come from on the firedac connection? Is that the ODBC connection name? I'm working through your example, thank you. I notice that my app gives a different error at run time. When connecting the firedac connection it gives data source name not found and no default driver specified, but AT design time it says it is connected fine???
  17. Damon

    Firedac connection to paradox via odbc

    ================================ Connection definition parameters ================================ Database=C:\Degei4\Data ODBCDriver={Microsoft Paradox Driver (*.db )} DataSource=degei4migration DriverID=ODBC ================================ FireDAC info ================================ Tool = RAD Studio 10.4 FireDAC = 27.0.0 (Build 99682) Platform = Windows 32 bit Defines = FireDAC_NOLOCALE_META;FireDAC_MONITOR ================================ Client info ================================ Loading driver ODBC ... Loading odbc32.dll driver manager Creating ODBC environment handle Driver Manager version = 03.81.19041.0000 ================================ Session info ================================ Current catalog = Current schema = Driver name = odbcjt32.dll Driver version = 10.00.19041 Driver conformance = 3 DBMS name = PARADOX DBMS version = 05.00.0000 Master.DB Master.MB Master.PX Master.VAL
  18. Damon

    Firedac connection to paradox via odbc

    Thank you but it really does not address the question. The odbc works, just not in delphi, or not in firedac. There must be an alternate way or fix for the connection. The odbc connection works for Crystal reports, it works for excel... surely there is a way to make it work in delphi. Installing the BDE is not an option. You "bridge" suggestion says it requires SQLLite.
  19. Anyone else seen this behavior? It is a recent problem. The print button is clicked but the dialog never appears. pdf still loads fine, but cannot print unless you save to file first. Troublesome. webbrowser1.Navigate('yourfile.pdf'); Also, Does anyone have the new TEdgeBrowser working? I have applied the git package and got the webview2.dll in the output folder with the exe and navigate fails. I cannot load any page. Edge version is Version 87.0.664.52 (Official build) (64-bit)
  20. Yes, i did try with the binaries, but it did not work. I will try the stand alone installer, thank you for this.
  21. Damon

    Setting Scroll Bar Width problem

    I have several tablets for time entry for staff with the issue of too small of scroll bars in my Delphi app. They are really only used for this app, so i simply set the values in the registry for the scroll bars to make them FAT. https://www.tenforums.com/tutorials/79875-change-size-scroll-bars-windows-10-a.html Works fine, but yes, changes for the entire system.
×