Jump to content

Damon

Members
  • Content Count

    25
  • Joined

  • Last visited

Community Reputation

0 Neutral

Technical Information

  • Delphi-Version
    Delphi 10.4 Sydney

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Damon

    Uploading photos to a web host.

    Ok, i had some time to go over this weekend and since i had made so many changes, just started over with the idftp, antifreeze and sslhandler. Ultimately, the following settings achieved a connection and successfully uploaded. idftp1.Host := 'ftp.myhost.net'; idftp1.Username := 'pics@myhost.net'; idftp1.Password := 'mypassword'; idftp1.Passive := true; //transfer type is binary //use tls is explicit //ssl handler set to 1.2 While i'm quite positive tried this combination, i must have had something else out of whack on the component causing the failure. Thank you Remy for pointing me in the right direction to take a careful look at the process.
  2. Damon

    Uploading photos to a web host.

    There is no code to review. I can't even get idftp1.connect; to work. idftp is set with the correct host, username, and password, port 21. Same as coreftp that works just fine. I see this as an issue in what the server wants vs the indy component providing or lack of. I have set passive to true, tls to explicit (as well as trying the others.) I've tried all tls versions. The farthest i got at one point was a socket timeout 10060. More often, it just comes back with an authentication error that is nondescriptive.
  3. Something that would seem it should be not difficult to implement is making me crazy. I've tried 50 combinations of setting with the indy idftp component and idanitfreeze and idssliohandler. Zero success. Multiple different errors. Ultimately it will not authenticate the connection. Coreftp has zero issues connecting with no fancy setting entries required. What on earth makes this so difficult. If these legacy indy components are the problem, please tell me. Delphi 12, indy 10.6.2 according to the about page. All i want to do is have my application connect to the hosting account with an ftp account that is setup, and let the user browse to a photo with an opendialog, and select that photo and have the application upload it. Frustrated. Thanks in advance for any insight.
  4. 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.
  5. 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.
  6. Here's another issue that seems to be only high dpi occuring.
  7. 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.
  8. 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.
  9. Happened to me this morning for the first time. Close/open the IDE resolved.
  10. 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. ?
  11. 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.
  12. 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');
  13. 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;
  14. 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;
  15. 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?
×