Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Syntax error converting varchar to data type int

Posted on 2006-11-20
4
Medium Priority
?
268 Views
Last Modified: 2010-08-05
Dear experts,

  I'm creating a search and result page in ASP using Dreamweaver MX 2004.

The URL Paramter passed from the search.asp page is a varchar datatype.  

I attempt to create a recordset in result.asp page using Dreamweaver MX 2004's Add Recordset Server Beheavior and add a Variable in Variables list as follow:

Name           Default Value     Run-Time Value      
-------          ----------------    ---------------------
srchParm     3ABC12345        Request.QueryString("txt_search")


When I press Test button, Dreamweaver MX 2004 returns an error message: Syntax error converting varchar "3ABC12345" to data type int


My Question:

Why would Dreamweaver MX 2004 want to convert the value of the variable to int datatype??
When I leave Default Value blank, DW MX 2004 returns an error message saying the default value is missing and the recordset cannot be saved.

I need to be able to show the search result base on the searching parameter on the search.asp page.  How do I get it to work?

Thank you very much!!!
0
Comment
Question by:cuconsortium
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17985251
please show the sql query / procedure code that you use.
the error is in there.

typically, it happens when you are trying to append a varchar and a numerical data. sql server gives priority to the numerical data (why, i don't know, but it's like that), so you have to explicitely convert the numerical value to varchar:

this will fail with your error:
select 'ABC' + 1

this will work:
select 'ABC' + convert(1 as varchar)

0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 18125422
I would prefer the PAQ with no points refunded, as the answer has been given IMHO... despite of the missing feedback of the questionner :-(
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 18153499
PAQed with no points refunded (of 500)

Computer101
EE Admin
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question