weird ODBC error in this ASP application

Results 1 to 3 of 3

Thread: weird ODBC error in this ASP application

  1. #1
    Steve M. Guest

    Default weird ODBC error in this ASP application

    Hi there.<BR><BR>I have a database, created in Access and upsized to SQL, that contains some text columns and 3 yes/no columns. I have an HTML form that users can fill out to update the database, but when they submit the form, the following error shows up:<BR><BR><BR><BR>Microsoft][ODBC SQL Server Driver][SQL Server]<BR>Disallowed implicit conversion from datatype &#039varchar&#039 to datatype &#039bit&#039 <BR>Table: &#039wsopm_private.dbo.Info&#039, <BR>Column: &#039Competitors&#039 <BR>Use the CONVERT function to run this query. <BR><BR>What?????<BR><BR>thanks!<BR><BR>--steve

  2. #2
    Join Date
    Dec 1969

    Default RE: weird ODBC error in this ASP application

    Is the Competitors column a bit column(yes/no) or a varchar column(text) in your SQL Server database? It sounds as if it&#039s a bit field. If so, make sure that in your INSERT or UPDATE statement you set the value to either 0(off) or 1(on). If you try and insert the value &#039ON&#039 or &#039OFF&#039 or any other text value, you&#039ll get the SQL error you mentioned.<BR><BR>Hope that helps

  3. #3
    Kurt Gustafson Guest

    Default RE: weird ODBC error in this ASP application

    Steve,<BR><BR>First off, I don&#039t know exactly your configuration is for your SQL database and your HTML code, but I will make a few assumptions...<BR><BR>I think that this problem stems from the fact that an HTML form stores your checkbox (which I assume you are using for your yes/no fields) as textual information. What I recommend you do, is to do some post processing (in the document you submit the form to) that checks the value of your checkbox and assigns an appropriate true or false to your SQL statement. This would require using some simple ASP and setting up a recordset component....but that should be fairly academic...<BR><BR>Hope this helps...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts