Author |
Topic |
|
sloppyhead
Starting Member
6 Posts |
Posted - 23 April 2002 : 12:57:05
|
what is the difference between "ChkString(Request.Form" and "Request.Form".
I have changed the Huer's portal's addcontent.asp, there was a former input called "Author", it still stndas there but I have used this field in db in order to write some other info.
then I have changed Request.Form("Author") to ChkString(Request.Form("Author"),"author") .
but with these changes, following sql statement gives me syntax error.
<% 'response.write "Edit Content"
case "addwrite" datum = DateToStr(strForumTimeAdjust)
Set rsLink = CreateObject("ADODB.Recordset")
strSQL = "INSERT INTO " & strTableprefix & "SITE_LINKS (Added, Hits,Score,Votes, SubmittedBy,CatId,Name,URL,LinkType,LinkDesc,Author,IMG,IMG_Type,Forum_Topic,Price,Validated) Values (" &_ "'" & datum & "', " &_ "0,0,0, " &_ "'" & Request.Form("MemberID") & "', " &_ " " & Request.Form("Category") & ", " &_ "'" & ChkString(Request.Form("LinkName"),"SQLString") & "', " &_ "'" & Request.Form("URL") & "', " &_ " " & Request.Form("LinkType") & ", " &_ "'" & ChkString(Request.Form("Message"),"message") & "', " &_ "'" & ChkString(Request.Form("Author"),"author") & "', " If Len(Request.Form("ImageURL")) = 0 OR Request.Form ("ImageURL") = "http://" Then strSQL = strSQL & ",Null,Null " Else strSQL = strSQL & ",'" & Request.Form("ImageURL") & "', " & Request.Form("IMG_Type") & " " End If If Len(Request.Form("Forum_Topic")) = 0 Then strSQL = strSQL & ",Null " Else strSQL = strSQL & ", " & Request.Form("Forum_Topic") End If If Len(Request.Form("Price")) = 0 Then strSQL = strSQL & ", 0" Else strSQL = strSQL & ", " & Request.Form("Price") End If If mLev = 4 Then strSQL = strSQL & ", 1) " Else strSQL = strSQL & ", 0) " End If
my_conn.execute strSQL %>
does anybody have any idea?
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 23 April 2002 : 13:32:54
|
what error are you getting ?
'author' is not an option for the chkString function so it won't do anything try using 'SQLString' instead
|
|
|
sloppyhead
Starting Member
6 Posts |
Posted - 23 April 2002 : 15:24:45
|
I am getting,
Microsoft JET Database Engine error '80040e14'
Syntax error in INSERT INTO statement.
/huwrs__portal_dev/addcontent.asp, line 543
Since I don't understand too much about that, I actualy try to make it resemble as much as what the "linkdesc" does.
I left it as it is, "'" & Request.Form("Author") & "' " , now it seems ok.
but I am not sure whether I am doing the right thing.
what is the difference between leaving it as "'" & Request.Form("Author") & "' " , or using different checkstring stc. stuff?
if it's a long stuff to explain, you may just say, "you're way is ok, go ahead", or "stop it".
|
|
|
|
Topic |
|
|
|