Syntax error converting from a character string to uniqueidentifier (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


box -> Syntax error converting from a character string to uniqueidentifier (9/13/2005 4:03:47)

Hi there any idea about this error? thanks a lot

Database Results Error
Description: Syntax error converting from a character string to uniqueidentifier.
Number: -2147217900 (0x80040E14)
Source: Microsoft OLE DB Provider for SQL Server

One or more form fields were empty. You should provide default values for all form fields that are used in the query.


My code:
<%
fp_sQry="UPDATE charge SET student_number='::student_number::',firstname='::firstname::',lastname='::lastname::',tri_mester='::tri_mester::',t_rate='::t_rate::',charge_amount='::charge_amount::',sub_charge='::sub_charge::' WHERE id='::id::'"
fp_sDefault="student_number=&firstname=&lastname=&tri_mester=&t_rate=&charge_amount=&sub_charge=&id="
fp_sNoRecords="<tr><td colspan=16 align=left width=""100%"">No records returned.</td></tr>"
fp_sDataConn="cahsu"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&"
fp_iDisplayCols=16
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>




Spooky -> RE: Syntax error converting from a character string to uniqueidentifier (9/13/2005 16:03:19)

Is one of those fields an unique identifier? eg "student_number" ?




box -> RE: Syntax error converting from a character string to uniqueidentifier (9/13/2005 16:08:04)

Hi Spooky only "ID" is identifier student_number is navachar. thanks




Spooky -> RE: Syntax error converting from a character string to uniqueidentifier (9/13/2005 16:39:21)

Remove the single quotes from the "ID" variable

WHERE id=::id::"





box -> RE: Syntax error converting from a character string to uniqueidentifier (9/13/2005 16:43:12)

Hi, If I do this I get this error:

Database Results Error
Description: Line 1: Incorrect syntax near '7'.
Number: -2147217900 (0x80040E14)
Source: Microsoft OLE DB Provider for SQL Server

One or more form fields were empty. You should provide default values for all form fields that are used in the query.




Spooky -> RE: Syntax error converting from a character string to uniqueidentifier (9/13/2005 16:51:03)

Is "7" the record being updated?




box -> RE: Syntax error converting from a character string to uniqueidentifier (9/13/2005 16:59:18)

No, i checked evrywhere I couldn't find anything related to 7 except my luck that i don't have!




Spooky -> RE: Syntax error converting from a character string to uniqueidentifier (9/13/2005 17:01:18)

With all of the changes above, and using known values, does the query run in Query analyser through enterprise manager?




box -> RE: Syntax error converting from a character string to uniqueidentifier (9/13/2005 17:14:51)

NOP, does not run! the strange thing is i have similar page which works fine but does not run in query analyzer either!




Spooky -> RE: Syntax error converting from a character string to uniqueidentifier (9/13/2005 17:16:25)

Whats the exact string you placed in query analyser?




box -> RE: Syntax error converting from a character string to uniqueidentifier (9/13/2005 17:27:03)

Query analyzer first case:

UPDATE charge SET student_number='::student_number::',firstname='::firstname::',lastname='::lastname::',tri_mester='::tri_mester::',t_rate='::t_rate::',charge_amount='::charge_amount::',sub_charge='::sub_charge::' WHERE id='::id::'

Server: Msg 8169, Level 16, State 2, Line 1
Syntax error converting from a character string to uniqueidentifier.


Query analyzer second case:
UPDATE charge SET student_number='::student_number::',firstname='::firstname::',lastname='::lastname::',tri_mester='::tri_mester::',t_rate='::t_rate::',charge_amount='::charge_amount::',sub_charge='::sub_charge::' WHERE id=::id::

Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near ':'.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.046875