Jump to content

bazzer747

Members
  • Content Count

    189
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by bazzer747

  1. bazzer747

    Component already exists

    Hi I've created a new Windows VCL application and on the first form I've added several buttons, each buttons click event opens a new form. Three of these forms are OK, I've added various components (buttons, navigators, grids etc) but on the last I opened has no components on it except a button (called btnClose) which simply closes the form. However, when I run the application and press the button that opens this form I get an error message: 'A component named btnClose already exists'. After selecting the OK to this error, if I click the same button again the application freezes and I use Task Manager to kill it. If I click the other buttons, they open their forms fine, but if I then click on the 4th one again I get 'Invalid pointer operation'. This is the form in text: object fViewSignups: TfViewSignups Left = 0 Top = 0 Caption = 'View Signups' ClientHeight = 299 ClientWidth = 678 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'Tahoma' Font.Style = [] OldCreateOrder = False PixelsPerInch = 96 TextHeight = 13 object btnClose: TRzButton Left = 520 Top = 40 Caption = 'Close' TabOrder = 0 OnClick = btnCloseClick end end ... no duplicate btnClose, also see attached screenshot. I created this form with: procedure TfMain.RzButton2Click(Sender: TObject); begin fViewSignups.Create( Self ); try fViewSignups.Showmodal; finally fViewSignups.Free; end; end; Which is identical to the way I created the other 3 forms which all work OK. I've closed everthing down and restarted everything and can't think of anythging else to look at to see where or why this error is happening. This is the first Windows application I've created since upgrading to Delphi 10.3.3, which may be something. Any thoughts on what else I can do would be appreciated.
  2. bazzer747

    MSSQL Busy

    A client has several of the applications I've written over the past several years and all work OK, They all connect (with FireDac) to a Microsoft SQL Server. However, I've just loaded a newer application (compiled in Delphi 10.3.3) and when I run it on this PC I get the following FireDac error message immediately (see attached): Exception EMSSQLNativeException in module ... at ..... [FireDAC][Phys][ODBC][Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt The PC is not running any other application that could be accessing the MS SQL Server, so I'm at a loss as to why it is busy at all. This application works fine on my development machine. Would this be a driver issue, maybe a newer driver is needed (is there one)? Or does Delphi 10.3.3/FireDAC do something differently to what it did in earlier versions? Any thoughts would be much appreciated.
  3. bazzer747

    Component already exists

    Arrgghhh! I've spotted the error. In the code I had fViewSignups.Create( Self ); Should be: fViewSignups:= tfViewSignups.Create( Self ); Silly type error, can't see the woods for the trees sometimes ... Works fine now.
  4. bazzer747

    Master-Detail Example

    Does anybody know where I can find a (simple) example of setting up a Master-Detail on two tables (MSSQL in my case)? All I can find via the internet are either overly complicated examples or in non-English languages. The Help in Delphi/Firedac is the former and very difficult to follow.
  5. bazzer747

    Master-Detail Example

    Many thanks, thought this was just a data question rather than specific to FireDac, but noted for next time ...
  6. Hi I have a plug-in (Konopka VCL) that shows it is being loaded at startup of Delphi (10.3.3), but which isn't working correctly. The GetIt package Manager doesn't show that this plug-in is installed so doesn't have an 'uninstall' option. It does have the 'install' option, but when I try this it fails when trying to copy files which are held by another process (presumably Delphi since it 'loaded' the plug-in at start - see attached screenshot). So for some reason it's got itself in a catch 22 state! I can neither use the plug-in nor uninstall it nor re-install it. I imagine I can uninstall the whole of Delhi and start again, but I'm wondering if there is a way to tell Delphi NOT to load that plug-in? If I can do that then maybe GetIt will install the plug-in without an error. Another option would be to run GetIT outside of Delphi, then it might work because Delphi would not be holding on to any files that would stop the copy process. Any thoughts would be useful.
  7. Hi David, That's interesting, I'll make a note of this when they go to 10.4. I'm always having issues with upgrading. I don't mind a complete uninstall/reinstall if the upgrade is a major one with most of the files having been changed, but a 10.3.2 to 10.3.3 seems a very minor one. Why they can't just do a replace of the files updated (like most other software vendors do) I don't know. Smacks of laziness to me.
  8. Hi Vandrovnik, After your post I wondered about the next error, assuming it was caused by my renaming the file. However, it wasn't (I took snapshots), it was for another file in a different plug-in. So I went back and tried the same again (renaming the file). And this time the install worked OK! So your answer was correct and it was my 'assumptions' that stopped me figuring this out first time. Many thanks for spurring me on.
  9. Hi I did this (well, I renamed it) and GetIt gave me yet another error.
  10. bazzer747

    Error insight in Rio

    Yes. 10.3.1 is just as bad. Doesn't anybody in Embarcadero read these posts and think 'Ah, an issue that bugs our community, I'll get it fixed'? I guess not as it never does. Not the only thing that never seems to work in new releases. Like try 'Tutorials' and click 'See more Snippets'. A blank screen!
  11. bazzer747

    So Many fdQueries

    In my application I have a Data Module which has 2 FD Connections (one for Test site one for Live site) and over 20 FDQueries for all the tables and views (I connect to MS SQL Servers). My application fails quite regularly with error saying cannot access a closed dataset, and I think it is because at some stage I've used ExecSQL to insert or update a record and this appears to change the query in the FDQ. Which means I'm having to re-specify the sql query in code several times throughout the application. It seems to me that this isn't very good coding/design. I can't use the FDCExecSQL command as I'm flipping between the Test and Live connections, again I feel this isn't the right way to do this. If anybody can suggest a better way to manage my connectivity to avoid having to re-specify queries I would be very grateful.
  12. bazzer747

    So Many fdQueries

    Hi, Many thanks for all suggestions., I done a lot more thinking of my problems and come up with the following code: procedure ConnectLiveTest( fdc: String ); var i: Integer; begin for i := 0 to dm.ComponentCount -1 do if dm.Components[ i ] is TFDQuery then begin if fdc = 'Live' then TFDQuery( dm.Components[ i ]).Connection:= dm.fdcLive1 else TFDQuery( dm.Components[ i ]).Connection:= dm.fdcTest1; TFDQuery( dm.Components[ i ]).Active := True; end; end; This allows me to quickly switch between Test and Live MSSQL Server databases. And (whilst I'm still testing) appears to work OK.
  13. bazzer747

    So Many fdQueries

    FDSQL - sorry, shorthand! Meant FDConnection1.ExecSQL (see http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Executing_Commands_(FireDAC)). Thanks for tips here, I'll certainly look into both (Good job Chrome can translate pages :-)).
×