Results 1 to 4 of 4
  1. #1
    hbtousa is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Aug 2019
    Posts
    8

    Attach multiple XML and .h files to MSA

    I have XML files and .h files on a single folder. A have a table with the following record structure: a song code following by 10 XML files and 4 .h files. Ex. song_code 00235 00235_01.xml 00235_02.xml.... 00235_10.xml and 00235_01.h 00235_02.h...00235_04.h Is it possible to attach the XML files and .h files to existing records on a database? I created a table with the type field attachment for the XML and .h files records; but, when I tried to add records I got an error message. I also wonder the following. I know the exact XML and .h filenames used on each record. Can I create some sort of a path filename similar to storing the path on an image in a text filed, and use some kind of control to attach the contents of the xml files and .h files?



    Thanks very muchClick image for larger version. 

Name:	attachement2.JPG 
Views:	15 
Size:	58.9 KB 
ID:	46160Click image for larger version. 

Name:	Attachment.JPG 
Views:	14 
Size:	21.4 KB 
ID:	46161
    Code:
    INSERT INTO XML ( [Song Code], [04 APP], [04 EXP], [04 MOD], [04 SEQ] )SELECT PythonXML.Field1, PythonXML.Field2, PythonXML.Field3, PythonXML.Field4, PythonXML.Field5
    FROM PythonXML;

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Many/most seasoned developers do not use attachment fields in Access. They can be buggy at worst and cause massive bloat at best. The usual approach is to have a table with a text field for the file path. To facilitate this, the file dialog (msoFileDialogFilePicker) or folder picker is often used to navigate to a file/folder and select it, whereupon code writes the path to the table. Which control on a form you need to present the files to a user I have no concrete idea since I don't know what .h files are. Perhaps it would be a web browser control.

    It looks like you've designed your table(s) like spreadsheets - not a good idea. You might want to research db normalization to see if you're on the right track. Tables should be tall (rows/records); spreadsheets are wide (columns). Table data is broken out into entity (table) - attribute (fields) format and related tables are joined by queries to get the data out.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    hbtousa is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Aug 2019
    Posts
    8
    Quote Originally Posted by Micron View Post
    I don't know what .h files are.
    A header file is a file with extension .h which contains C function declarations and macro definitions to be shared between several source files. Here https://www.tutorialspoint.com/cprogramming/c_header_files.htm just in case you want to research

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    I took a look but C is not something I have never dabbled in.
    Don't know if you must store attachments, but if so, I think the only option aside from manually adding one by one is to use code. There are lots of examples and some videos out there on how to do that. I'd pick one that uses DAO and try that.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. How to Attach Files to Posts
    By Micron in forum Forum Suggestions
    Replies: 15
    Last Post: 06-19-2022, 09:01 PM
  2. Replies: 1
    Last Post: 04-10-2019, 11:39 AM
  3. Attach Multiple PDFs to Access via Script
    By dimitrius20 in forum Access
    Replies: 2
    Last Post: 03-06-2015, 02:31 PM
  4. Replies: 31
    Last Post: 08-15-2012, 03:33 PM
  5. How do you bulk attach files in Access?
    By newyorkyankee in forum Access
    Replies: 5
    Last Post: 05-11-2012, 01:06 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