Can you use a DSN instead of the VBA assigned connection string?
.Connect would then start "ODBC;DSN=..."
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
In MS Access VBA, when I create a temp querydef object with odbc driver to run the SQL by pass-through query, a warning occur "XXX is not a valid name. Make sure that it does not include invalid characters or punctuation and that it is not too long"。
Then I check all the parameter settings. When I shorten the querydef.connect, it works. Then I discover the string's length of querydef.connect is limited to 255 characters.
Because I need to connect remote database server by using local SSL certifaction ,so I can't shorten the connect characters. Is there any good idea to execute the querydef with long connect string?
Dim MyQuery as DAO.QueryDef
Set MyQuery = CurrentDb.CreateQueryDef("")
MyQuery.Connect = "ODBC;****" 'longer then 255 characters
MyQuery.SQL = "*****"
MyQuery.ReturnsRecords = False
MyQuery.Execute
Can you use a DSN instead of the VBA assigned connection string?
.Connect would then start "ODBC;DSN=..."