Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server ASP
Password Reminder
Register
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 Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools 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
Reply With Quote
  #2 (permalink)  
Old October 31st, 2008, 03:45 AM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,652
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.
Reply With Quote
Reply


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 09:24 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.