Wrox Programmer Forums
|
SQL Server ASP Discussions about ASP programming with Microsoft's SQL Server. For more ASP forums, see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 31st, 2008, 02:20 AM
Registered User
 
Join Date: Oct 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Vb Error

hi,
i have problen here,

I'm runing slurping engine. but i'm getting error here

below lines i'm getting error

Set rsDetails = conn.Execute("insertAdDetails " & Replace(AD_ID, "'", "") & "," & Replace(Seller_ID, "'", "") & ",1,1,13,0, '" & Replace(Colour, "'", "") & "'")

the error is
Error Converting data type varchar to int
 
Old October 31st, 2008, 02:45 AM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

I would *GUESS* that the last argument there--Colour--should be an integer, but you are passing a string (that is, 'xxx' where xxx is the value of your Colour variable.

Anyway, you are also making a major goof in using REPLACE with numeric values.

MUCH MUCH BETTER--and safer--to do:
Code:
SQL = "insertAdDetails " & CLNG(AD_ID) & "," & CLNG(Seller_ID) & ",1,1,13,0, '" & Replace(Colour, "'", "") & "'")
Response.Write "DEBUG SQL: " & SQL & ""
Set rsDetails = conn.Execute( SQL )
Incidentally, if that INSERT does NOT return a recordset, you should not bother assigning it to the rsDetails variable.

And, again, if COLOUR should really be a number (and I think it probably should be, based on the error message), then:
Code:
SQL = "insertAdDetails " & CLNG(AD_ID) & "," & CLNG(Seller_ID) & ",1,1,13,0," & CLNG(Colour)
Response.Write "DEBUG SQL: " & SQL & ""
Set rsDetails = conn.Execute( SQL )
But ALWAYS ALWAYS ALWAYS learn to DEBUG! Put in lots of Response.Write calls, so you can see what is happening.

If you still can't figure it out, show us the code from the stored procedure.





Similar Threads
Thread Thread Starter Forum Replies Last Post
VB Error: Syntax Error or Access Violation codehappy VB How-To 7 October 3rd, 2007 05:41 PM
VB Error: BC30455 brite ASP.NET 1.0 and 1.1 Basics 0 March 28th, 2007 02:14 PM
converting .NET error object in VB error object webnet .NET Web Services 0 February 5th, 2007 06:02 AM
VB error navenmp Pro VB 6 1 January 15th, 2007 11:39 AM
Getting an Error in VB Programme selam70 Pro VB Databases 1 September 28th, 2004 08:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.