Forum Moderators: open

Message Too Old, No Replies

Problem with MSSQL

I get an error saying '80040e14'

         

elifer

9:54 am on Oct 24, 2004 (gmt 0)

10+ Year Member



Can someone help me out with this error?

Microsoft OLE DB Provider for SQL Server error '80040e14'

Line 1: Incorrect syntax near '*'.

/tos/admin/inc_type.asp, line 187

txbakers

5:33 pm on Oct 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi, welcome to the Webmaster World!

It looks like you have incorrect syntax in your query.

If you can post the SQL statement, we can probably find it.

elifer

5:47 pm on Oct 24, 2004 (gmt 0)

10+ Year Member



Hello txbakers,

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

topr8

6:24 pm on Oct 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



what are you using as your char value for the date?

try it without gaps maybe?

txbakers

8:49 pm on Oct 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The conversion of char data type to smalldatetime data type resulted in an out-of-range smalldatetime value

That error is pretty self-explanatory. You are trying to convert a CHAR datatype to a smalldatetime and the database don't like it.

elifer

3:18 am on Oct 25, 2004 (gmt 0)

10+ Year Member



This is line 57

_______________________________________

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?

duckhunter

12:44 pm on Oct 25, 2004 (gmt 0)

10+ Year Member



'"&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;")

mattglet

2:01 pm on Oct 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Actually, isn't it like this, because GETDATE is a SQL function, not an ASP/VBScript function? Otherwise you'd get an invalid function call.

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;")

duckhunter

4:57 pm on Oct 25, 2004 (gmt 0)

10+ Year Member



Yes, you are correct. My bad!

elifer

7:19 pm on Oct 25, 2004 (gmt 0)

10+ Year Member



Hello guys,

I am really pround that you are helping me thanks a lot guys.

I hope some day I can also help you out. Thanks a lot!

Dazalou