|
Convert ADO fields to XML tags without errors
XML tag names can't contain several special characters or spaces. Therefore, when you
use ADO field names as XML tags, make sure to rename the fields, if necessary, in the SQL
statement. For example, if you use the following SQL statement:
Select [Employ ID], Name FROM Employees
and then use XMLDOM to convert the recordset fields into XML, the XML
document will generate an error. That's because XMLDOM's creation methods
convert the [Employ ID] fieldname into <Employ ID>. However, the space is an invalid
character. To avoid this error, use an alias name in the SQL string, such as:
Select [Employ ID] AS EmployID, Name FROM Employees.

|