Mike P wrote:
I am repeatedly getting the error message 'error converting datatype
varchar to bit'. I am passing a varchar variable to a stored procedure
(where it is also a varchar) and then trying to write it to a table
(where it is also a varchar). I have no idea why it is trying to
convert it to a bit, it is very puzzling. Has anybody else had an
error like this?
Yes, I have encountered this error, and every single time it was caused
by a mistake I made when writing either the stored procedure itself, or
my ADO code to execute the procedure. Every time.
Can you successfully run the procedure from Query Analyzer?
If so, then it's a problem with your ADO code, which you should post
along with the "CREATE PROCEDURE ... AS" section of your procedure
creation script (we don't need to see the entire script in this case).
See here for my recommended method for executing procedures via ASP/ADO:
http://groups.google.com/group/micro...09dc1701?hl=en
If not, it is a problem with the stored procedure itself, whose script
you should post. If you can whittle everything out of the precedure
except the part that raises the error, that would be helpful, not only
for us but you as well: going through that exercise might help you spot
the problem yourself.. We need to see the table creation DDL as well -
relevant portion only please.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.