we have an application that is in Access forms accessing to SQL Server. We want to keep SQL's comment into the SQL code of our queries, but this code throw an exception (3075) :
Dim strSQL As String
Dim dbs As DAO.Database
Set dbs = CurrentDb
strSQL = "SELECT /* 123456 */ NAA_CODE_NATURE_PK, NAA_LIBELLE_NATURE FROM RGZ_NATURES_AFFAIRE ORDER BY NAA_LIBELLE_NATURE"
Set rs = dbs.OpenRecordset(strSQL, dbOpenSnapshot)
We have tried with dbExecDirect, dbSQLPassThrough and finally dbExecDirect + dbSQLPassThrough as the third argument of the OpenRecordset method, but this does not works at all...
Any solution ?
Thanks