Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

file.to_blob code works in Windows XP, doesn't work in Windows 7

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    file.to_blob code works in Windows XP, doesn't work in Windows 7

    Would anyone have any idea why the following code works fine in Windows XP but does not work in Windows 7.
    My guess is the file.to_blob is failing so the blob can not be written to the field, statement.

    Code:
    tbl.enter_begin(.t.)
    		
    dim b as B
    b = file.to_blob(vcfilename)
    tbl.statement = b
    		
    tbl.enter_end(.t.)
    Alpha 5 Version 11
    AA Build 2999, Build 4269, Current Build
    DBF's and MySql
    Desktop, Web on the Desktop and WEB

    Ron Anusiewicz

    #2
    Re: file.to_blob code works in Windows XP, doesn't work in Windows 7

    Good morning, Ron,

    Suggest you check

    1) contents of 'vcFilename' - is there a path issue here?
    2) run script with debug to see what Alpha can tell you.
    3) verify that the local machine can "see" the source drive and folder
    4) what data type is the source file? BMP's and JPEG's come in different flavors. For example, is the source no longer an 8 bit BMP?

    -- tom

    Comment


      #3
      Re: file.to_blob code works in Windows XP, doesn't work in Windows 7

      Hi Tom and thank you for your reply.

      I'm not sure if this is the issue, but I'm running Win 7 32-bit under Oracle VM VirtualBox. I don't have a Windows 7 machine to test this on. I've spent too much time chasing this so my next step is to install the app on a real win 7 machine and see if it works.

      Ron
      Alpha 5 Version 11
      AA Build 2999, Build 4269, Current Build
      DBF's and MySql
      Desktop, Web on the Desktop and WEB

      Ron Anusiewicz

      Comment


        #4
        Re: file.to_blob code works in Windows XP, doesn't work in Windows 7

        Ron,

        I have run across this in Win7 due to a permissions issue with writing/changing a file in the root of the OS (C usually) drive and the Programs folder....changing to say any default shared area such as My Documents solved the issue. You didn't mention where you were attempting to do this but figure I'd add this to mix to cover more bases.
        Mike
        __________________________________________
        It is only when we forget all our learning that we begin to know.
        It's not what you look at that matters, it's what you see.
        Henry David Thoreau
        __________________________________________



        Comment


          #5
          Re: file.to_blob code works in Windows XP, doesn't work in Windows 7

          Hi Mike,

          Initially I had trouble creating the file. That was because I had the path wrong. I fixed it but I am writing the file to my app->data folder.

          program files->a5runtime->app_Data

          So creating and writing the file is not my problem. My problem is the reading/changing the file to a blob and then writing the blob to a bitmap field in my table.

          Works fine in XP. I get nothing in Win 7.

          Ron
          Alpha 5 Version 11
          AA Build 2999, Build 4269, Current Build
          DBF's and MySql
          Desktop, Web on the Desktop and WEB

          Ron Anusiewicz

          Comment


            #6
            Re: file.to_blob code works in Windows XP, doesn't work in Windows 7

            Could someone please look at this attached example. There is either something wrong with my code or I think there is a bug. This code works fine when run with Windows XP SP3. It fails when run with Window 7.

            The example has some tables, a report and a script. Run the script. Select the excel file, test.xls which I have included with the database. The script runs slowly, so just wait for the message box to appear when the script is finished. The application mspaint will open and be manipulated by xbasic code. At the end, the script opens a report. I�ve attached a copy of what the report is suppose to look like.

            Line 101 of the script has a delay value as part of the script runs as if it is a macro. Depending on the speed of the computer, the delay value may need to be changed. The delay value is in seconds and can be tenths.

            Code:
            dim vnDelay as N
            vnDelay = 1.0
            I suspect that the problem code is lines 150 through 152.

            Code:
            fn = vcfilename
            b = file.to_blob(fn)
            tbl.statement = b
            It appears that the line b=file.to_blob does not work with Window 7.

            Can someone try to verify this for me?

            Thanks,

            Ron
            Attached Files
            Alpha 5 Version 11
            AA Build 2999, Build 4269, Current Build
            DBF's and MySql
            Desktop, Web on the Desktop and WEB

            Ron Anusiewicz

            Comment


              #7
              Re: file.to_blob code works in Windows XP, doesn't work in Windows 7

              Oops,

              I forgot to attach the database file.

              Attached Files
              Alpha 5 Version 11
              AA Build 2999, Build 4269, Current Build
              DBF's and MySql
              Desktop, Web on the Desktop and WEB

              Ron Anusiewicz

              Comment


                #8
                Re: file.to_blob code works in Windows XP, doesn't work in Windows 7

                program files->a5runtime->app_Data
                that would be: "c:\program files\a5runtime\myapp"

                Are we to assume your app resides in program files on your computer? If so, may I suggest you move it to a folder on the root of the drive like: "c:\myapp" ? it may help with your problem.

                Microsoft has been working for over ten years to get data out of program files. A couple of times they caused data not to work at all in there and then eased back. I saw most of these first in betas we got and they were changed later in final product, but now they are tying it down pretty hard.
                Dave Mason
                [email protected]
                Skype is dave.mason46

                Comment


                  #9
                  Re: file.to_blob code works in Windows XP, doesn't work in Windows 7

                  I got it to work by replacing:

                  fn = vcfilename
                  b = file.to_blob(fn)
                  tbl.statement = b

                  with:

                  tbl.statement.memo_read_from_file(vcfilename)
                  Mike W
                  __________________________
                  "I rebel in at least small things to express to the world that I have not completely surrendered"

                  Comment


                    #10
                    Re: file.to_blob code works in Windows XP, doesn't work in Windows 7

                    Hi Mike,

                    Thank you for your suggestion. Unfortunately, it does not work on my machine. I've attached my window 7 report. The bitmap field is not being written to. I've tried this on my production application, the test application that I've uploaded to this board and my production application on a window 7 notebook computer. Nothing works.

                    I wonder if there could be a timing issue????

                    Your suggestion and my original code work flawlessly with window XP.

                    Thanks,

                    Ron
                    Attached Files
                    Alpha 5 Version 11
                    AA Build 2999, Build 4269, Current Build
                    DBF's and MySql
                    Desktop, Web on the Desktop and WEB

                    Ron Anusiewicz

                    Comment


                      #11
                      Re: file.to_blob code works in Windows XP, doesn't work in Windows 7

                      Hi Ron,

                      Originally posted by Ronald Anusiewicz View Post
                      I wonder if there could be a timing issue????
                      While not impossible, I don't think it's very likely it would be a win 7 vs win xp issue. Reading and writing blobs is key code in Alpha that I think would fail long before this issue.

                      Timing is possible, but I have not looked at your code or application, and still would doubt that as a cause.

                      Permissions would still be the most likely cause. Try it in safe folders that the current Win User definitely can use (e.g. My Documents). Also, try turning off UAC and see if the problem in Win 7 goes away.

                      To get the config info and folders of both machines, I suggest you try installing my free CSDA DiagInfo and then compare the environments.
                      Regards,

                      Ira J. Perlow
                      Computer Systems Design


                      CSDA A5 Products
                      New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
                      CSDA Barcode Functions

                      CSDA Code Utility
                      CSDA Screen Capture


                      Comment


                        #12
                        Re: file.to_blob code works in Windows XP, doesn't work in Windows 7

                        I want to apologize for not getting back sooner with the answer to this problem. Unfortunately, my father passed away on January 31st following a 6 week illness and my day to day routine is just now starting to return to normal.

                        As it turns out, the default file type in Windows XP paint is a BMP file. In Windows 7 the default file in Paint is a PNG file. So even though I was naming the file with a .BMP extension, in reality, the file was a .PNG file. After altering my scripting xbasic to set the File Type to a .BMP file, everything worked fine.

                        Thank you to all who tried to help me with this problem.

                        Ron
                        Alpha 5 Version 11
                        AA Build 2999, Build 4269, Current Build
                        DBF's and MySql
                        Desktop, Web on the Desktop and WEB

                        Ron Anusiewicz

                        Comment


                          #13
                          Re: file.to_blob code works in Windows XP, doesn't work in Windows 7

                          Ron

                          My condolences.

                          Thanks for the solution.

                          Hope for better days.
                          Al Buchholz
                          Bookwood Systems, LTD
                          Weekly QReportBuilder Webinars Thursday 1 pm CST

                          Occam's Razor - KISS
                          Normalize till it hurts - De-normalize till it works.
                          Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                          When we triage a problem it is much easier to read sample systems than to read a mind.
                          "Make it as simple as possible, but not simpler."
                          Albert Einstein

                          http://www.iadn.com/images/media/iadn_member.png

                          Comment


                            #14
                            Re: file.to_blob code works in Windows XP, doesn't work in Windows 7

                            Ron,
                            Thank you for sharing your personal moment and all that you certainly bring to our community here. My condolences as well, sir.
                            Mike W
                            __________________________
                            "I rebel in at least small things to express to the world that I have not completely surrendered"

                            Comment

                            Working...
                            X