Re: convert function

From: Bob Barrows (reb01501_at_NOyahoo.SPAMcom)
Date: 02/21/04


Date: Sat, 21 Feb 2004 08:09:03 -0500

shank wrote:
> I'm getting the following error...
>
> Microsoft OLE DB Provider for SQL Server error '80040e07'
> Disallowed implicit conversion from data type varchar to data type
> money, table 'wsOrders', column 'ShippingCost'. Use the CONVERT
> function to run this query.
>

> SQL = SQL & "Values ('" & io_ShippingCost & "')"
> DataConn.Execute(SQL)
> %>
>
> What am I doing wrong?
> thanks!

What you are doing wrong is using string delimiters around that numeric
value. Response.Write that SQL variable and verify that the resulting
statement will run in query analyzer before attempting to run it from asp.

The line should be:
SQL = SQL & "Values (" & io_ShippingCost & ")"

> Does anyone have examples of the CONVERT function?
Not needed in this case, but have you looked in Books Online (BOL)? It
should be installed on your pc - look in the SQL Server program group in
your Windows Start menu.

Bob Barrows

-- 
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Relevant Pages

  • Re: Problems with new security patch....
    ... SQL Server is terminating this process. ... Queries like this had been running since May. ... >> Microsoft OLE DB Provider for SQL Server error '80040e14' ...
    (microsoft.public.sqlserver.security)
  • sp_Start_Job confuses job_id with job_name?
    ... Microsoft OLE DB Provider for SQL Server error '80040e14' ...
    (microsoft.public.data.ado)
  • Re: Access 97 to SQL
    ... The timestamp is a data type, ... the timestamp field does not need to be part of the SELECT ... > converted the Access tables to a SQL Server 2000 database and linked the ... > the way I set up Autonumbering in SQL? ...
    (microsoft.public.access.externaldata)
  • cannot access website
    ... Nerve.com--this started a few weeks ago; I do not get the error message on ... Microsoft OLE DB Provider for ODBC Drivers Error '80040e4d' ... Not defined as a valid user of a trusted SQL Server connection. ... The DSN used to connect to the Commerce database is misconfigured to use ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Data Types
    ... > moved to SQL Server and I don't know the best newsgroups yet. ... > Does a Unique Identifier data type take up less storage space than a 32 ... A uniqueidentifier uses 16 bytes. ... but I'm looking at the data types and think that the TimeStamp ...
    (microsoft.public.sqlserver.programming)