OutFront Forums
     Home    Register     Search      Help      Login    

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

 

Syntax error converting from a character string to uniqueidentifier

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP, PHP, and Database >> Syntax error converting from a character string to uniqueidentifier
Page: [1]
 
box

 

Posts: 162
Joined: 12/10/2002
Status: offline

 
Syntax error converting from a character string to uniq... - 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

 

Posts: 26630
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Syntax error converting from a character string to ... - 9/13/2005 16:03:19   
Is one of those fields an unique identifier? eg "student_number" ?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

Sp:)ky


(in reply to box)
box

 

Posts: 162
Joined: 12/10/2002
Status: offline

 
RE: Syntax error converting from a character string to ... - 9/13/2005 16:08:04   
Hi Spooky only "ID" is identifier student_number is navachar. thanks

(in reply to box)
Spooky

 

Posts: 26630
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Syntax error converting from a character string to ... - 9/13/2005 16:39:21   
Remove the single quotes from the "ID" variable

WHERE id=::id::"



_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

Sp:)ky


(in reply to box)
box

 

Posts: 162
Joined: 12/10/2002
Status: offline

 
RE: Syntax error converting from a character string to ... - 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.

(in reply to Spooky)
Spooky

 

Posts: 26630
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Syntax error converting from a character string to ... - 9/13/2005 16:51:03   
Is "7" the record being updated?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

Sp:)ky


(in reply to box)
box

 

Posts: 162
Joined: 12/10/2002
Status: offline

 
RE: Syntax error converting from a character string to ... - 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!

(in reply to Spooky)
Spooky

 

Posts: 26630
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Syntax error converting from a character string to ... - 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?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

Sp:)ky


(in reply to box)
box

 

Posts: 162
Joined: 12/10/2002
Status: offline

 
RE: Syntax error converting from a character string to ... - 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!

(in reply to Spooky)
Spooky

 

Posts: 26630
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Syntax error converting from a character string to ... - 9/13/2005 17:16:25   
Whats the exact string you placed in query analyser?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

Sp:)ky


(in reply to box)
box

 

Posts: 162
Joined: 12/10/2002
Status: offline

 
RE: Syntax error converting from a character string to ... - 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 ':'.

(in reply to Spooky)
Page:   [1]

All Forums >> Web Development >> ASP, PHP, and Database >> Syntax error converting from a character string to uniqueidentifier
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts