Forum Moderators: open
Thanks for your replay I want first to know what does this error mean?
_______________________________________________
Microsoft OLE DB Provider for SQL Server error '80040e07'
The conversion of char data type to smalldatetime data type resulted in an out-of-range smalldatetime value.
/link/admin/admin-writelink.asp, line 57
_______________________________________________
I hope you can help me out!
Thanks
_______________________________________
if func = "write" then
objConn.Execute ("INSERT INTO links (title, description, url, catid, datein, active, hits,"_
& " email, recipurl, comments, contact, popular, emailopt, votes, rating, posts, threads, "_
& " userid, hitsin, dhitsin, mhitsin, ldayin, lmonthin, linktype) SELECT '"_
& SQLEncode(Request.Form("title")) & "' AS title,'" _
& TSQLEncode(Request.Form("description")) & "' AS description,'" _
& Request.Form("url") & "' AS url," & Request.Form("catid") &" AS catid, '"&date&"' AS datein, " & myTrue & " AS active, 0 AS hits,'"_
& Request.Form("email") & "' AS email, '"& Request.Form("recipurl")_
& "' AS recipurl, '" & TSQLEncode(Request.Form("comments"))_
& "' AS comments, '" & Request.Form("contact")_
& "' AS contact, "& Request.Form("popular") &" AS popular, "& Request.Form("emailopt") &" AS emailopt, " _
& " 0 AS votes, 0 AS rating, 0 AS posts, 0 AS threads, 0 AS userid, 0 AS hitsin, 0 AS dhitsin, 0 AS mhitsin, 0 AS ldayin, 0 AS lmonthin, " & Request.Form("linktype") & " AS linktype;")
__________________________________________
I don't know what is wrong?
'"&date&"' AS datein
Are you trying to pull the current datetime? If so, use the getdate() function in SQL or Now() in VBScript. The &date& looks like you are trying to use MSAccess syntax.
Try this:
objConn.Execute ("INSERT INTO links (title, description, url, catid, datein, active, hits,"_
& " email, recipurl, comments, contact, popular, emailopt, votes, rating, posts, threads, "_
& " userid, hitsin, dhitsin, mhitsin, ldayin, lmonthin, linktype) SELECT '"_
& SQLEncode(Request.Form("title")) & "' AS title,'" _
& TSQLEncode(Request.Form("description")) & "' AS description,'" _
& Request.Form("url") & "' AS url," & Request.Form("catid") &" AS catid, " & getdate() & ", " & myTrue & " AS active, 0 AS hits,'"_
& Request.Form("email") & "' AS email, '"& Request.Form("recipurl")_
& "' AS recipurl, '" & TSQLEncode(Request.Form("comments"))_
& "' AS comments, '" & Request.Form("contact")_
& "' AS contact, "& Request.Form("popular") &" AS popular, "& Request.Form("emailopt") &" AS emailopt, " _
& " 0 AS votes, 0 AS rating, 0 AS posts, 0 AS threads, 0 AS userid, 0 AS hitsin, 0 AS dhitsin, 0 AS mhitsin, 0 AS ldayin, 0 AS lmonthin, " & Request.Form("linktype") & " AS linktype;")
objConn.Execute ("INSERT INTO links (title, description, url, catid, datein, active, hits,"_
& " email, recipurl, comments, contact, popular, emailopt, votes, rating, posts, threads, "_
& " userid, hitsin, dhitsin, mhitsin, ldayin, lmonthin, linktype) SELECT '"_
& SQLEncode(Request.Form("title")) & "' AS title,'" _
& TSQLEncode(Request.Form("description")) & "' AS description,'" _
& Request.Form("url") & "' AS url," & Request.Form("catid") &" AS catid, GETDATE(), " & myTrue & " AS active, 0 AS hits,'"_
& Request.Form("email") & "' AS email, '"& Request.Form("recipurl")_
& "' AS recipurl, '" & TSQLEncode(Request.Form("comments"))_
& "' AS comments, '" & Request.Form("contact")_
& "' AS contact, "& Request.Form("popular") &" AS popular, "& Request.Form("emailopt") &" AS emailopt, " _
& " 0 AS votes, 0 AS rating, 0 AS posts, 0 AS threads, 0 AS userid, 0 AS hitsin, 0 AS dhitsin, 0 AS mhitsin, 0 AS ldayin, 0 AS lmonthin, " & Request.Form("linktype") & " AS linktype;")