Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2010
    Posts
    20

    Is there equivalent code in VBA?

    This appears to be .NET framework code.
    ByteImage = System.IO.File.ReadAllBytes("C:\my folder\my file")




    Since I am not using .NET, is there equivalent code in VBA (Access 2007) that will do the same thing?

  2. #2
    jgelpi16 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544
    I am not familiar with .NET. What is that code trying to do? I think you may want to try "Call Shell"

    Code:
     Call Shell("""C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE"" ""C:\my folder\my file""", 1)

  3. #3
    Join Date
    Jul 2010
    Posts
    20

    import and convert to binary

    The code is supposted to import a file and convert the incoming data to byte (binary).

  4. #4
    DaveT is offline Access Developer
    Windows 7 Access 2010 (version 14.0)
    Join Date
    May 2010
    Location
    Texas
    Posts
    69
    Might take a look at the Open Statement in Access help, for example
    Open "TESTFILE" For Binary Access Read Lock Read As #1

  5. #5
    Join Date
    Jul 2010
    Posts
    20

    it worked!

    many thanks for the responses!!.....the "Open X for binary access read....." solved the problem!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. WeekdayName equivalent in 2000
    By sunnybrook in forum Queries
    Replies: 8
    Last Post: 07-14-2010, 10:47 PM
  2. Code help
    By Alex Motilal in forum Forms
    Replies: 3
    Last Post: 06-17-2010, 07:12 AM
  3. Access 2003 code vs Access 2007 Code
    By ralphjramirez in forum Access
    Replies: 5
    Last Post: 11-23-2009, 12:33 PM
  4. Help with vba code
    By rockape in forum Programming
    Replies: 11
    Last Post: 09-29-2009, 06:49 AM
  5. Need help with code
    By hoenheim in forum Programming
    Replies: 9
    Last Post: 09-11-2008, 04:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums