
SQL Server 6.5 + ADO problem...
Hi,
The Source property return something like (not exactly) "Ole db provider for
SQL Server".
Actually, I've add a watch to the Errors collection, and examine all the
properties, but found nothing related to error source (i.e. field name), so
any better method?
Regards,
Ming
Quote:
> > Hi,
> > I'm using SQL Server 6.5 and VB+ADO for writing simple application. My
> table
> > has two field with CHECK and RULE binded:
> ...
> > When I use VB to add save a new record, with both field entering invalid
> > value, the state rule fires first. I've check the connection object's
> Errors
> > collection, and found the correct error message indicating which field
was
> > the error source.
> > "A column insert or update conflicts with a rule imposed by a previous
> > CREATE RULE command. The command was aborted. The conflict occurred in
> > database 'pubs', table 'testing', column 'state' "
> > My problem is: The only way I can found to handle this error is to check
> the
> > message to locate the field with error, in this case, 'state'. This is a
> > test application only, in real world application, there are probably
more
> > fields to handle, so I need to have an array of fields and scan each
> against
> > the message to find the error source? or I need to check the message to
> look
> > for specific keyword to locate the error field ("in database 'xxxx'")?
> > What will happen if this message change in later implementation? Any
> object
> > will have a specific property storing the error source (database, table,
> > field, etc)?
> ...
> Lots of questions, not sure of all the answers. First, have you checked
the
> Source property on the ADO Errors object? Does it perhaps give you the
> tablename or fieldname?