Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i get this error.. i dont know how to fix it . here is the code :

SQL
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/lib.asp"-->
<!--#include file="inc/md5.asp"-->
<!--#include file="inc/config.asp"-->

<%
if(request("action")="save") then
    UserName = GetPostField("UserName")
    oldpass = GetPostField("oldpass")
    moldpass = GetPostField("moldpass")
    ans = GetPostField("ans")
    quest = GetPostField("quest")
    email = GetPostField("email")
    num = GetPostField("num")
    qq = GetPostField("qq")
    CheckCode = GetPostField("Checkcode")

    checkzw(UserName)

    If CheckCode=Empty Or Trim(Session("MuGetCode"))<>CheckCode Then
        msg("ÄúÌîдµÄÑéÖ¤ÂëÓëϵͳ²úÉúµÄ²»Ò»Ö£¬ÇëÖØÐÂÊäÈë")
    end if

    if num="0" then msg("¶Ô²»Æð,Ö¤¼þºÅÂë±ØÐëΪÊý×Ö")

    if(ChkInvaildWord(UserName) or ChkInvaildWord(email) or ChkInvaildWord(oldpass) or ChkInvaildWord(moldpass) or ChkInvaildWord(quest) or ChkInvaildWord(ans) or ChkInvaildWord(num) or ChkInvaildWord(qq) or ChkInvaildWord(ServerCode)) then
        msg("Çë²»ÒªÊäÈë·Ç·¨×Ö·û")
    end if

    if oldpass <> moldpass then
        msg("Á½´ÎÃÜÂë²»Ïàͬ")
    end if

    md5pass=md5(oldpass,32)
    md5UserName=md5(UserName,32)

    Set rs = Server.CreateObject("ADODB.Recordset")
    rs.Open "Select * from Accounts  where AccountName='"&UserName&"'",conn
    if Not rs.Eof then
        rs.close
        msg("¸ÃÓû§ÃûÒѾ­±»×¢²á£¬ÇëʹÓÃÆäËûÓû§Ãû")
    else
        conn.execute("insert into Accounts (AccountName,AccountLevelCode,CharacterCreateLimit,CharacterMaxCount,RegisterDate,PublisherCode,Passphrase) values ('"&UserName&"','0','4','7','2014-01-20 12:12:12','4','"&md5pass&"') ")
        rs.close

        '×¢²áËͽðÇ®
        set rs = nothing
        set rs1 = nothing
        msg "Cuenta Registrada con exito!."
    End If

else

    msg3("ÄãµÄIpÐÅÏ¢ÒѾ­±»¼Ç¼£¬Çë²»Òª·Ç·¨Ìá½»")

end if
%>
Posted
Updated 8-Mar-14 3:03am
v2
Comments
CHill60 8-Mar-14 9:05am    
I've updated the indentation on your post to make it clearer.
On which line are you getting the error and what language is the code written in? ( I don't mean "Spanish"!)
Member 10653417 8-Mar-14 9:12am    
On the line 45 . i need to use the MD5 enryption for a password table.

and ASP
PIEBALDconsult 8-Mar-14 9:09am    
I suspect that the problem can be solved by using a parameterized query. In particular, the UserName and md5pass aren't strings, yet you are trying to concatenate them into a string. This is bad on several levels. Use parameters.

1 solution

insert into Accounts (AccountName,AccountLevelCode,CharacterCreateLimit,CharacterMaxCount,RegisterDate,PublisherCode,Passphrase) values ('"&UserName&"','0','4','7','2014-01-20 12:12:12','4','"&md5pass&"') ")


The error is in this query.
One of these fields types is incorrect. Check the date value and column type.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900