Relative Content

Tag Archive for excelvbaadodb

How do I preserve é (e-acute) character from SQL DB to ADODB recordset to Excel through VBA?

I have an Excel VBA project that iterates through a list in a parameter table and populates data using the rows of the parameter table to provide arguments for the parameters of the SQL Query to a SQL Server DB. This is to produce n versions of an excel document from n rows in the parameter table in the master macro-enabled workbook. Unfortunately, I’ve run aground on the dumbest snag I could possibly imagine. Some of the data requested in the SQL DB includes the é (e-acute) character but when it runs through the ADODB recordset object, it comes out the other side as a □ (WHITE SQUARE, U+25A1). This fouls things up because I A) need the correct character shown in the published documents and B) my code is matching the stings returned by the SQL query to values in the spreadsheet and it is failing on these messed up characters.