![]() | |
![]() |
| | Thread Tools | Display Modes |
#21
| ||||
| ||||
|
|
Gene Wirchenko (genew (AT) ocis (DOT) net) writes: It is not multiple errors. It is multiple rows of error data being returned. Preliminarily, it is an error message row followed by zero or more rows of inculpated column names. e.g. OrderBy ErrorResponse 0 Foo must be less than bar. 1 foo 2 bar 0 is the error message to be emitted. 1 and 2 are the involved columns from which the front-end will select the first one in the form tab sequence to set the focus to. There are of course error checks that belongs in the database, because they work with the data. This does not the least apply to update procedures. |
|
However, I would recommend that you don't overdo it. T-SQL is not a very good language from a general programming perspective. Earlier this day I was battling how to formulate an error message that for a while read like: Column(s) [a] exists only in the left table, but they are not at the end While the message can apply to multiple columns, I expect that most commonly there will be only one, so the bad grammar will hurts the eye. Had I written this code in Perl I might have crafted a message that was correct both for singular and plural, but in T-SQL the code for that would be just too verbose, and I eventually I found a way to convey the message that did not depend on verb inflection. |
|
I think I've written something like you have in mind about once in my career. And that was in SQL 2000 with no TRY-CATCH. With TRY-CATCH it becomes even more difficult to produce multiple error message. Unless you return them as result sets, but then you need a clear protocol so that your client knows what result set gets back. |
|
Something I've used a little more often is when I have had a table with rows that needs to be processed, and each row is processed independently, or at least there are groups of rows that are independent of each other. In such cases, I put a status column and a message column in the table where I write error status and message. |
#22
| |||
| |||
|
|
Huh? Of course it involves updates. I do not want bad data getting into the database. That is the point of the error checks. Did you misstate, or am I missing some context here? |
|
Do you mean that your input table gets modified with the result? Something like: SomeKey } Data1 } Process Data2 } this. Data3 } ProcessingStatus } What happened ProcessingErrorMessage } goes here. |
#23
| |||
| |||
|
|
Gene Wirchenko (genew (AT) ocis (DOT) net) writes: My understanding is that in order to access the data with the browser, I have to create an ADODB.Connection object and an ADODB.Recordset object using ActiveXObject() which Firefox (for example) does not have. If there is another way of doing it, I would be delighted to find out how. Old ADO is a technology that dead in the sense that there is no further development with it - and has not been for a decade or so. It exists in legacy applications, but it is nothing you should use for a new application in 2012. ADO was crap already in its heyday, and now it also suffers from lack of support for new features in SQL Server. You should use ADO .Net, or possibly JDBC or PHP as your data access API. (The old thing old ADO and ADO .Net has in common are three letters.) As for being browser-independent or not - if you make your application to run on IE only, you will have to deal with irritated users who prefers to use a different browser. |
#24
| |||
| |||
|
|
ADO was installed as part of MDAC, but is now part of WDAC which comes with the operating system of Windows Vista and later. ADO is not yet deprecated, and is (AFAIK still) THE way to access your SQL Server data - if you're not using a .NET programming language. |
#25
| |||
| |||
|
|
Jason Keats (jkeats (AT) melbpcDeleteThis (DOT) org.au) writes: ADO was installed as part of MDAC, but is now part of WDAC which comes with the operating system of Windows Vista and later. ADO is not yet deprecated, and is (AFAIK still) THE way to access your SQL Server data - if you're not using a .NET programming language. No, that would be ODBC. |
|
ADO does not fully support new data types added to SQL Server. The ones that are supported are only because they fit into the OLE DB framework at the time, for instance the date data type. (Where as time does not work, since the time data type in SQL Server does not mach TIME in OLE DB.) |
#26
| |||
| |||
|
|
And today if you write native code, I would assume that your language is C++, where ODBC rather fits better than ADO. But, for anyone using ADO (and not the ODBC API), the solution is not to use incompatible data types in your database! :-) Right. The solution is to switch to an API that gives full support for what the database exposes. |
#27
| |||
| |||
|
|
It looks like its time to drop VB6 and ADO and move to C++ and ODBC. ;-) |
#28
| |||
| |||
|
|
Jason Keats (jkeats (AT) melbpcDeleteThis (DOT) org.au) writes: It looks like its time to drop VB6 and ADO and move to C++ and ODBC. ;-) Or .Net. There is still room for native code - SQL Server is full of that - but the applications that are in native code because they should be were rarely implemented in VB6. |
#29
| |||
| |||
|
|
Erland Sommarskog wrote: Jason Keats (jkeats (AT) melbpcDeleteThis (DOT) org.au) writes: It looks like its time to drop VB6 and ADO and move to C++ and ODBC. ;-) Or .Net. There is still room for native code - SQL Server is full of that - but the applications that are in native code because they should be were rarely implemented in VB6. That was supposed to be a joke, Erland. I doubt very much that I'll ever use C++ or ODBC (directly). I am using .NET on the server. It's just unfortunate that Microsoft doesn't have a good (ie, not C++) native code replacement for VB6. |
![]() |
| Thread Tools | |
| Display Modes | |
| |