Is it possible to query an OleDB connection to find out if you must use square brackets or quotes?
SQL:
SELECT [FullName] From [My Users]
Oracle
SELECT "FullName" From "My Users"
MySQL:
SELECT `FullName` From `My Users`
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
OLE DB itself has the IDBInfo interface with the GetLiteralInfo method. A couple of the pieces of information in it are DBLITERAL_QUOTE_PREFIX and DBLITERAL_QUOTE_SUFFIX, which is the information you are looking for. If the provider you are using exposes that interface, then you should be able to access it through ADO via the OpenSchema method. The SchemaEnum contains adSchemaDBInfoLiterals, which should return a Recordset with the desired information.