Monday, August 21, 2023
Part of the day Sunday, I spent tweaking my new Access database which stores the Amazon affiliate links for my stores. I ran into a problem with the Visual Basic for Applications (VBA) module that generates the HTML code for each Amazon store. I spent at least two hours resolving this issue.

Okay, I started this post with how I resolved an issue without explaining what led to the problem.
Below, an illustration of how the Gift Ideas products were rendered on the page before I decided to use a Microsoft Access database to maintain my Amazon affiliate links.

When I first started updating my stores to use product links rather than the Native Shopping Ads resource (feature retiring), I simply used Amazon's SiteStripe to copy the product affiliate link information for each product- for inclusion to my pages. For those unfamiliar with how the Amazon affiliate resource SiteStripe works- the graphic below provides illustration.

Because I wanted to add descriptive information about each product, I added a field to the database which I included in the HTML generated for each product. The problem, initially the descriptions were a bit lengthy and took up a lot of "real estate" without the corresponding link. Only the image had the link.
To overcome this, I decided to parse the AffiliateData field (example shown below) for each product, only retrieving the actual link, so I could include the link around the descriptive text without creating a new field for just the link.

This was not as straight forward as I thought it would be, however I did come up with a solution, and I am happy with how I have decided to maintain my Amazon affiliate links.
Below is an illustration of the new Gift Ideas page with the new links, images, and linked descriptions for each product- as provided by the Access database.

I liked this exercise because it allowed me to work with Visual Basic again, and I always want to stay up to date with the latest issues with software areas I support.
