February 26, 2019 at 11:22 am
Dear all,
This issue occurs repeatedly with a table with columns that are somewhat managed dynamically in the sense that columns may be added or removed on occasion. The application attempts to bind with the table using a CRecordset class (dynamically bound). The issue is that this recordset class will fail to open the table with the error "Restricted data type attribute violation". This error will repeat twice in a row and then will not replicate again for a while. "A while" is an unknown length of time. While the time has not fully passed, the recordset will attach, open, and operate on this table like nothing is wrong. Once that time has passed "restricted data type attribute violation" error comes back. I have already attempted using different API conversions for dates.
Any help will be greatly appreciated...
Application framework: MFC/C++
SQL Server drivers tested/replicated:
- SQL Server 2017 (14.0.3049.1), OS - MS Windows Server 2016 Standard 64-bit
- Application Server OS Windows Server 2012R2 64-bit
- ODBC Driver for 11 for SQL Server
- ODBC Driver for 13 for SQL Server
Column types used:
- varchar
- datetime
- float
- int
February 26, 2019 at 1:12 pm
Could you post the full and complete error message you receive. Also, are there any other errors in the SQL Server error log at the same time?
February 26, 2019 at 3:15 pm
Thank you for the quick reply!... Please see complete message below and there are no errors in SQLS logs recorded at the time of occurrence.
February 27, 2019 at 3:10 pm
Anybody?...
February 27, 2019 at 3:23 pm
This looks like it may be more of a user defined error than a SQL Server error. I base this on the fact that there is no error number in the message. Could be the application is hiding that part of the error, but not sure. Also, you said there were no errors reported in the SQL Error log. Not much to go on.
March 6, 2019 at 7:03 am
manalyticsdev - Tuesday, February 26, 2019 11:22 AMDear all,
This issue occurs repeatedly with a table with columns that are somewhat managed dynamically in the sense that columns may be added or removed on occasion. The application attempts to bind with the table using a CRecordset class (dynamically bound). The issue is that this recordset class will fail to open the table with the error "Restricted data type attribute violation". This error will repeat twice in a row and then will not replicate again for a while. "A while" is an unknown length of time. While the time has not fully passed, the recordset will attach, open, and operate on this table like nothing is wrong. Once that time has passed "restricted data type attribute violation" error comes back. I have already attempted using different API conversions for dates.
Any help will be greatly appreciated...
Application framework: MFC/C++
SQL Server drivers tested/replicated:
- SQL Server 2017 (14.0.3049.1), OS - MS Windows Server 2016 Standard 64-bit
- Application Server OS Windows Server 2012R2 64-bit
- ODBC Driver for 11 for SQL Server
- ODBC Driver for 13 for SQL Server
Column types used:
- varchar
- datetime
- float
- int
Well, I don't know about you, but if I were a framework, such as .Net, I'd not be happy to work correctly if the schema for my data was changed behind my back, and nobody told me about it. Frameworks are not going to handle that kind of thing well. However, you haven't indicated anything other than you have a custom error message and that you have a schema that changes regularly. If you are using a relational database, why would you be allowing such frequent changes? And given such changes, why would you expect any framework to work well with such a thing? Honestly, the expectation that you can "get away with that" is not realistic. You probably need a much better database design that can accommodate additional data more easily.
Steve (aka sgmunson)
Rent Servers for Income (picks and shovels strategy)
March 6, 2019 at 8:37 am
manalyticsdev - Wednesday, February 27, 2019 3:10 PMAnybody?...
Are you going to provide us with more information?
March 6, 2019 at 12:09 pm
You can probably get more information by turning on ODBC tracing but it does generate a lot of log data and with the error being sporadic, that may be too disruptive. It does slow things down when it's enabled. Or if you have an environment where the logging won't affect anything (such as your PC or development) and you do experience the error, testing in that environment might be an option.
A couple of scenarios where you could get the error are explained in these articles:
Enhanced Date and Time Type Behavior with Previous SQL Server Versions (ODBC)
Cross-Version Compatibility
Sue
Viewing 8 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy