Jump to content

JohnLM

Members
  • Content Count

    334
  • Joined

  • Last visited

Everything posted by JohnLM

  1. JohnLM

    How do I handle the 'closed dataset' error ?

    Okay, that may work to prevent it from happening. And I will try that at a later time in this app. But there are other causes that will show 'closed dateset' error, and I will need to at last be able to reopen the dataset and StringGrid. The user should not have to keep closing down and rerunning an app. At least that is what I want to avoid if possible.
  2. JohnLM

    How do I handle the 'closed dataset' error ?

    I created the new record procedure to make it easier to add new UNIQUE records. And I was using that to re-create the issue in order to help resolve the 'closed dataset' issue. So, yes, the statement is correct. It can enter new records with no problem. This is an example script that I am using to post the same info into the query. It works fine as long as i keep the IDNo unique, so adding a 7 instead of the 6 would work, and so on. I am just duplicating the error to work out solving the 'closed data' issue. insert into tblBarcodes values (6, '120422', 'Q', 'abc1', '2 120422 Q abc1 desc1'); select * from tblBarcodes; So, the question remains, how do I reopen the dataset to show its contents through the StringGrid again, without having to close the app, and run it again?
  3. JohnLM

    How do I handle the 'closed dataset' error ?

    Please note, this is an FMX app, so live-bindings is utilized. And the reason I am working this as a Windows app is to speed up these kinds of issues versus if I was to start this in an Android project. For testing purposes for this db, I was manually writing the script to add the new record while in the IDE. And when the issue first came about, and to work out a resolution, I needed a way to re-create it so I can learn and fix it. So, I created a [new record] button and added the code to add the new record, so that every time I run the app and press the [new record] button, it would pop up the error. Note: [btnPostClick()) is the actual procedure, not [new record]. It's in this [new record] procedure that I am trying to work out the code to refresh the dataset/stringgrid to show what is current, below. procedure TForm1.btnPostClick(Sender: TObject); // post or add a new record. // this works. 12/4/sun begin conn.Connected:=true; // to reopen the dataset qry.Close; // most people say to close first then reopen qry.Open; // open dataset, stringgrid should now show // original code qry.FindLast; qry.SQL.Clear; qry.SQL.Assign(m1.Lines); // qry.Open; // remmed out for now, to test try/finally below // end of original code // here, trying catch the error and stop it (but it doesnt) try qry.Open; except on e : exception do ShowMessage('Cannot open tblBarcodes, error is: ' + e.message); end; end;
  4. Progress update.. Success! and Resolved! Thanks to the help here, I now have a working delete method that will do what I need. Below is what I decided to implement, crude but works. var Form1: TForm1; LSQLText: string; // SQL string for [deleting last row] LastRowValue: string; // from StringGrid . . procedure TForm1.btnDelLastRowClick(Sender: TObject); // this routine works! 12/4/sun late pm // delete last row, but is actually [current row selected in stringgrid] begin LastRowValue := sg1.Cells[sg1.Col,sg1.Row]; beep; LSQLText := Format('delete from tblBarcodes where IDNo=%s', [LastRowValue]); // do the row deletion here.. qry.SQL.Clear; //('delete from tblBarcodes where IDNO=2'); // <-- i.e., qry.SQL.Add(LSQLText+';'); qry.SQL.Add('select * from tblBarcodes;'); qry.ExecSQL; // show me the updated list conn.Connected:=true; qry.Active:=true; end; However, I now have another problem, but I will post a new topic for that. Thank you all for your responses.
  5. Issue/Problem: when deploying an app to android that has the: (camera, json, or barcode components on a form) the app starts up with a black screen flame and hangs and closes down. Has anyone tried the trial version of TMS FNC WX Pack Android? -- link: https://www.tmssoftware.com/site/tmsfncwxpack.asp I have been having a difficult time with the trial version v1.5.1.0 (via Getit) working on my smartphone with Android 10, using Delphi 11.2 Alexandria Professional under Windows 7 and also Windows 10 laptops. The trial version states to set it in release mode (For mobile device deployment, the trial version supports deploying in release mode only) which I have done, but after the app is deployed I still have a black screen with the Delphi flame and it eventually closes whenever click out of the screen. I am hoping that someone with similar experience knows how to resolve this issue. I would really appreciate the help. Thank you.
  6. Update.. and Success.. Sorry for the long delay. As it turned out, I had to update my smartphone's Android version from 10 to 12, and now all is working with the trial. However, I've since purchased their product.
  7. Hi. I saw that method used in other areas of my search. However, I can't us it because I don't know what the value is because I am using a barcode scanner in real-time, and the number scanned gets inserted into the db. However, as I re-read this, and ponder it in my head, I think I might be able to accomplish it somehow, by getting the data from say, the first column in the query, and feed that to the code you posted. hmm. If I go to .Last, I just have to figure out how to pull the field's content into a variable and then feed that somehow into the qry.SQL.Text;="" part.
  8. Update.. 11-19-2022 Sat 6:18pm 1. I found out that this component pack requires a 64-bit Android and be compiled for 64-bit applications. If your compiler IDE supports 64-bit platforms (i.e., Delphi 11 Alexandria supports 32/64-bit platforms for Android), the apps will compile and deploy to an Android device via the USB cable. 2. Delphi XE7 Professional only supports 32-bit compile/deployment for Android - so compiling and deploying over to Android will result in a black screen display. 3. Delphi 11 Alexandria (Professional) (I have 11.2) supports 32 and 64-bit compile/deployment for Android. For this Trial version 1.5.1.0 component, I have tested short custom-made apps to compile and deploy over to my smartphone (Android 10) under Windows 7 and Windows 10, successfully. In these tests, I only added the FNC WX camera component, and two regular TButtons (for Start camera and Stop camera event functions). And there is no black screen. All the components show as usual in any app created. However, the FNC WX's camera component does not work. There is no video/image displayed. To get this far, I had to add two files to the Libraries folder, for this package on my laptop install, as it was located in my "C:\Users\{your-computer-name}\AppData\Local\tmssoftware\trial\TMSFNCWXPack {RSXE7}\Android Support" folder, and locate and add the following two files into the Libraries section in your IDE: * JavaScriptHelper.jar * FNCWebChromeClient.jar right-click on the yellow [Libraries] folder, shown below, and select Add.. .. and add the two files mentioned above, to it. Once completed, you should see the two files when you click the down-arrow and scroll down, shown below. Create a new project, form, and add the two tbuttons and fnc wx camera component to the form. and add these two code snippets to turn on/off the camera. procedure TForm1.btnStartClick(Sender: TObject); begin cam.Stop; cam.CameraType := wctFront; // or change to wctBack cam.Start; end; procedure TForm1.btnStopClick(Sender: TObject); begin cam.Stop; end; Compile and see what happens in your final product. When I compile and deploy my version to my smartphone (Android 10), and select the Start button, I get no video/image. It is a blank white area, as seen below. I will post an update in another post if I find any additional answers or success.
  9. Windows 7 Home 64bit Delphi XE7 Professional update 1 with FireDAC and Mobile add-on Indy version 10.6.1.518 Android version 10, (on smartphone) Android versions 4.4.4, and 4.4.2 (both on tablets) Issue/Problem: When I launch the app on Android, and click on the [Submit] button, the app shuts down when it tries to access the idhttp section here: idHttp1.get(url_address); It works fine under Windows FMX and VCL, just not Android. Can someone please help me resolve this? Thank you. History: Hi. I have been successfully creating small utility apps on my android devices (Galaxy S10+ (android 10) and tablets (android 4.x.x)) for the last 8 years. I've been playing around with a new windows project using API through OMdbAPI (an IMDB knock-off) to get quick movie/tv series info. The API is free for 1000 requests. I love it. It works well. Usage is simple, using the following -> [https://www.omdbapi.com/?t=Contact&apikey={8-dig-key-code}] as it will give back a JSON string (below), then I parse it to get back a two-column detail to visualize the data better. Later I plan to fine-tune it and display only certain info from it. Right now, I am simply debugging it on Windows 7 and Android. {"Title":"Contact","Year":"1997","Rated":"PG","Released":"11 Jul 1997","Runtime":"150 min","Genre":"Drama, Mystery, Sci-Fi","Director":"Robert Zemeckis","Writer":"James V. Hart, Michael Goldenberg, Carl Sagan","Actors":"Jodie Foster, Matthew McConaughey, Tom Skerritt","Plot":"Dr. Ellie Arroway, after years of searching, finds conclusive radio proof of extraterrestrial intelligence, sending plans for a mysterious machine.","Language":"English, Spanish, German, Russian","Country":"United States","Awards":"Nominated for 1 Oscar. 14 wins & 32 nominations total","Poster":"https://m.media-amazon.com/images/M/MV5BYWNkYmFiZjUtYmI3Ni00NzIwLTkxZjktN2ZkMjdhMzlkMDc3XkEyXkFqcGdeQXVyNDk3NzU2MTQ@._V1_SX300.jpg","Ratings":[{"Source":"Internet Movie Database","Value":"7.5/10"},{"Source":"Rotten Tomatoes","Value":"68%"},{"Source":"Metacritic","Value":"62/100"}],"Metascore":"62","imdbRating":"7.5","imdbVotes":"274,457","imdbID":"tt0118884","Type":"movie","DVD":"16 Dec 1997","BoxOffice":"$100,920,329","Production":"N/A","Website":"N/A","Response":"True"}
  10. Update.. Great news.. after so many weeks and hours of searching and reading (and breaks, here and there), I have finally succeeded!! No more issues with SSL errors. I am now able to deploy apps using Indy v10.6.1.518 to my Galaxy S10+ smartphone (Android 10) using Delphi XE7 Professional under Windows 7 Home Prem 6 GB ram 64-bit laptop. I suffered many headaches over this. The screenshot below shows proof that I accomplished it. It is the same VCL app that I posted a screen copy of in my original post above, but this time in a redesigned FMX framework and deployed to the android 10 smartphone. I actually owe the thanks to Remy, from reading one of his posts over in StackOverFlow from 2016 through 2021. Actually, all the answers were spread out across many forums and topics. I just had to piece them all together somehow. This link, over at StatkOverFlow, https://stackoverflow.com/questions/37105600/error-could-not-load-ssl-library-on-android-with-tidhttp helped me to figure out the last piece of the missing part of many parts to get all this working. An excerpt from Remy's response near the bottom of that topic: So, thank you Remy
  11. I am trying to work out some issues with compiling certain components and need to list out all installations that pertain to Android development. I use the Android SDK tool to install various Android files. Although I can compile apps and deploy them to my Android device, I believe that I have messed things up pretty well, I think. F:\Users\Public\Documents\Embarcadero\Studio\15.0\PlatformSDKs\adt-bundle-windows-x86-20131030\sdk\tools\ --> Android Tools And I want to list out the same details seen below but in "text" format (so that I can post it to someone). I don't want to post it as an image like the below, plus also because there are a lot more info not seen in this image below and would require multiple images to post, and it would be better to post a text file and send that off to the person. Is there a command line tool that I can use to obtain the same text and layout? I can clean it up to look in a similar layout as in the image just above if I have to. Thanks.
  12. Windows 7 Home 64bit Delphi XE7 Professional update 1 with FireDAC and Mobile add-on Indy version 10.6.1.518 Android devices: (smartphone v10, and tables v4.4.4, and v4.4.2) I am having trouble trying to get these projects copied via Save-as and Save-project-as from the IDE, to another version'ized folder. When I start a project, I normally create a folder that describes the application name. Then, I create a version folder (i.e., v01, v02, ... v10, and so on) so that I can see the version of that project. This helps me to keep project apps organized, debugging, etc.. ** My steps are as follows for working with and saving a project into a new version folder: ** (this is just before I close down Delphi for the project) 1. open or create a project, E:\XE7\VCL\JasonParser\v01\JasonParser_v01.dproj 2. do work on that project. If the project is working well, I will quickly determine if that will be the final working version. If I decide, yes, then I will create a new version folder. ** Create new version folder: ** 3. Save-as (this saves the unit) thus, save into E:\XE7\VCL\JasonParser\v02\unit1.pas 4. Save-project-as, thus, save into E:\XE7\VCL\JasonParser\v02\JasonParser_v02.dproj 5. then, either I shut down Delphi or start a new project via steps 1 through 5. However, being my first time creating a project-group, I am lost as to how to copy over the whole project to a new version folder so that I can work on the project. The issue I am having is that the second project group is not carrying over. How do I fix this?
  13. To be safe and mostly headache-free, I am making a backup copy of the F: drive mem stick, and after that, I will re-image my laptop's C: drive using Reflect Macrium. This way I can restore both mediums if all else fails.
  14. @Rollo62, I didn't realize you were linking to an Indy-alternative. Anway, thank you. I have no issues on the Windows side of things when using Indy, so far. But my needs are for Android 10 and onward. And I would need an http.get() equivalent to Indy's. Once again, thanks for your suggestion.
  15. My XE7 Pro is installed on an USB-3 external F: drive and not the usual C: drive. Will that be an issue with installation? Do I need to change certain files to reflect this?
  16. Remey, I am not a GitHub user and don't understand that hierarchy system and the discussions are difficult to follow in order to get to the step(s) for the solution or links or downloads. I'm on my way to work. Later, I will try and search this forum to see if there is a download link and installation instructions. If I don't find any, I may have to start another topic on this Indy Upgrade process.
  17. Yes, I had not mentioned that earlier today I updated my original post (at the top).
  18. update.. I have the issue partially solved, in the two tablets only. But, to answer Remy's question. I don't have the latest version because I had never used them in mobile devices.. only in Windows. And I never had any issues. They just worked. In Android mobile devices is where and when I just found out they don't work. Well, at least not for Android 10 on my smartphone. So, I wouldn't know if they are outdated and/or need to be upgraded. But, as it turns out, for the Android 4.4.2 and 4.4.4 on my two tablets, I did not have the Internet turned on, for those two devices. You see, in order to save battery life, I had turned off the auto-internet feature of those devices, and when I started using them in this project and with the Indy tidhttp component for the first, that is when I discovered all this trouble. However, the app no longer gives me any trouble for android 4.4.2 and 4.4.4 on the tablets.., it is working fine. I just need to get it working on the smartphone.
  19. update.. I decided to remove the tidhttp1 and IdSSLIOHandlerSocketOpenSSL1 components and re-add them to the project. This time, the LG Android 4.4.2 tablet is giving me this message: "Error resolving Address www.omdbapi.com: (7)"
  20. Just to update you on the process.. I am using the USB cable to deploy apps on the android, not the Google Store. I have never used that route, nor do I know anything about it. I use the USB route to add apps to my android device(s). Right up to now, I was using my smartphone, S10+ which has Android 10 on it. This device shuts down the app. Now, I am trying my old Acer tablet with Android 4.4.4 and an even older LG tablet with Android 4.4.2 on it. When I attempt to deploy the app on either of them via the USB cable, (and press the [submit] button in the app to process the idhttp) the app on both tablets does not shut down, instead, they display the same message: "IOHandler value is not valid" I thought for sure, that the LG 4.4.2 tablet would work for the "idhttp" component on android since I purchase both Delphi XE7 Pro and it, back in December 2014. So now, I am wondering if anyone ever did use the Indy TidHttp component on these much older androids successfully.
  21. Hi, I'm still up trying to find a solution. I've recently read about the TNetHTPClient, but it is for XE8 and onward. I have not found any package of it for XE7. If I can't find a solution for Indy, then I am hoping there is a component (with a similar operation to idhttp) elsewhere.
  22. Dave, (or anyone else) which section from the posted link should I be looking at? Looking through the maze of info, (it is all confusing to me. I am no Android expert. ) I have tried random ideas but still had no success.., the app continues to shut down.
×