p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > SQL Server > SQL Server ASP
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 31st, 2008, 03:20 AM
Registered User
 
Join Date: Oct 2008
Location: Mumbai, Maharashtra, India.
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
__________________
no
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old October 31st, 2008, 03:45 AM
Friend of Wrox
Points: 4,805, Level: 29
Points: 4,805, Level: 29 Points: 4,805, Level: 29 Points: 4,805, Level: 29
Activity: 50%
Activity: 50% Activity: 50% Activity: 50%
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,323
Thanks: 3
Thanked 70 Times in 69 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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
VB Error: Syntax Error or Access Violation codehappy VB How-To 7 October 3rd, 2007 06:41 PM
VB Error: BC30455 brite ASP.NET 1.0 and 1.1 Basics 0 March 28th, 2007 03: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 09:07 AM



All times are GMT -4. The time now is 02:06 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc