This topic is locked
[SOLVED]

  Field Type Problem

8/30/2012 2:42:40 PM
ASPRunnerPro General questions
H
hsan author

I am using lookup wizard that pulls data from the table of external database (I've created view in mssql)to a table in my Database. Everything is working, but when I go to Print page i get error "The data types text and nvarchar are incompatible in the equal to operator". The field that is causing this is a "text" field "Description"(i know this because when I take it off Add page everything works), but it belongs to external database that I cannot change field types. My corresponding Field is called "Desc". The dropdown box I choose value from is "PartNo" (also populated from external database table). How can I make it work?
Thanks a lot

Sergey Kornilov admin 8/30/2012

Could you post exact error message here? It's not clear what exactly causes the trouble.

H
hsan author 8/30/2012

Exact error:
"Microsoft OLE DB Provider for SQL Server error '80040e14'

The data types text and nvarchar are incompatible in the equal to operator.

/P51/include/aspfunctions.asp, line 1242"
It is the 'Description" field I was talking about. When I remove it, no more errors. But I cannot change that field type.

Sergey Kornilov admin 8/30/2012

Post lines 1230-1250 from include/aspfunctions.asp file here pointing which line is 1242. We'll add some debug info to find what exactly is happening.
What strange is that this is happening on print page only.

H
hsan author 8/31/2012



Post lines 1230-1250 from include/aspfunctions.asp file here pointing which line is 1242. We'll add some debug info to find what exactly is happening.
What strange is that this is happening on print page only.


Here is the output
end function
function db_exec(sSQL,conn)

if IsIdentical(dDebug,true) then response.write sSQL & "
"

conn.Execute sSQL

call ReportError

end function
function db_query(sSQL,conn)

dim asp_rs

if IsIdentical(dDebug,true) then response.write sSQL & "
"

Set asp_rs = server.CreateObject("ADODB.Recordset")

1242 asp_rs.Open sSQL,conn

call ReportError

set db_query=asp_rs

end function
function db_query_direct(sSQL,conn,a)

set db_query_direct=db_query(sSQL,conn)

end function
function db_fetch_array(asp_rs)

Sergey Kornilov admin 8/31/2012

Try to add the following line

Response.Write sSQL&"
" : response.flush


right before

asp_rs.Open sSQL,conn


Post here SQL queries from the page that breaks.

H
hsan author 8/31/2012

Just to clarify - the error pertains to a field in the table view that is derived from a different mssql database (which I cannot modify). The field type is text. I've found a workaround - if i create field alias in print page I can change the field type and everything works.