|
|
 |
| 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.
|
 |

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

October 31st, 2008, 03:45 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,323
Thanks: 3
Thanked 70 Times in 69 Posts
|
|
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.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |