all groups > inetserver asp db > july 2005 >
Hi, I have a “Yes/No†data field in MS Access database that I am trying to update. Here is my update statement, strSQL = "UPDATE dndusers SET Active = Yes WHERE E_Mail='" & Request.QueryString("email") & "' AND Activation_Code = " & fRandomPassword & ";" I get an error message saying "No value given for one or more required parameters" and points to “.Execute†line. Here is my code. I have never worked with “Yes/No†data field before and when I print the strSQL, I see all the variables have values. Can someone tell me why I am getting this error? Thanks for your time. Joe Dim objConn Dim objRS Dim bUserExist bUserExist = FALSE Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=E:\test\databases\test.mdb;" Set objRS=Server.CreateObject("ADODB.Recordset") strSQL = "SELECT * FROM dndusers " & "WHERE E_Mail='" & Request.QueryString("email") & "' AND Activation_Code = '" & Request.QueryString("activatecode") & "';" objRS.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly, adCmdText If Not objRS.EOF And Not objRS.BOF Then bUserExist = TRUE strSQL = "UPDATE dndusers SET Active = Yes WHERE E_Mail='" & Request.QueryString("email") & "' AND Activation_Code = " & fRandomPassword & ";" Set updateCmd = Server.CreateObject("ADODB.Command") With updateCmd .ActiveConnection = objConn .CommandText = strSQL .Execute End With objRS.Close()
Even 1 and 0 doesn't work, I get following error, Microsoft JET Database Engine error '80040e10' No value given for one or more required parameters. /customerportal2/dnd/activate.asp, line 61 The line 61 is '.Execute'. With updateCmd .ActiveConnection = objConn .CommandText = strSQL .Execute End With This is not realted to write permission beacsue I can insert record in this database witout any problem. The SQL statement is, UPDATE dndusers SET Active = 1 WHERE E_Mail='test2005@canada.com' AND Activation_Code = lnuqxynzoe; [quoted text, click to view] "Ray Costanzo [MVP]" wrote: > Don't use "yes." That word means nothing. Use true or false, or 1 or 0 > (preferred). > > strSQL = "UPDATE dndusers SET Active = 1 WHERE ...." > > Ray at work > > "Joe" <Joe@discussions.microsoft.com> wrote in message > news:A8F53145-85D5-49C8-BD99-2347EFF30B9D@microsoft.com... > > Hi, > > > > I have a "Yes/No" data field in MS Access database that I am trying to > > update. Here is my update statement, > > strSQL = "UPDATE dndusers SET Active = Yes WHERE E_Mail='" & > > Request.QueryString("email") & "' AND Activation_Code = " & > fRandomPassword & > > ";" > > > > I get an error message saying "No value given for one or more required > > parameters" and points to ".Execute" line. > > > > Here is my code. > > > > I have never worked with "Yes/No" data field before and when I print the > > strSQL, I see all the variables have values. Can someone tell me why I am > > getting this error? > > > > Thanks for your time. > > > > Joe > > > > Dim objConn > > Dim objRS > > Dim bUserExist > > > > bUserExist = FALSE > > > > Set objConn = Server.CreateObject("ADODB.Connection") > > objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _ > > "Data Source=E:\test\databases\test.mdb;" > > > > Set objRS=Server.CreateObject("ADODB.Recordset") > > strSQL = "SELECT * FROM dndusers " & "WHERE E_Mail='" & > > Request.QueryString("email") & "' AND Activation_Code = '" & > > Request.QueryString("activatecode") & "';" > > objRS.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly, adCmdText > > > > If Not objRS.EOF And Not objRS.BOF Then > > bUserExist = TRUE > > strSQL = "UPDATE dndusers SET Active = Yes WHERE E_Mail='" & > > Request.QueryString("email") & "' AND Activation_Code = " & > fRandomPassword & > > ";" > > Set updateCmd = Server.CreateObject("ADODB.Command") > > With updateCmd > > .ActiveConnection = objConn > > .CommandText = strSQL > > .Execute > > End With > > objRS.Close() > > > >
[quoted text, click to view] "Joe" <Joe@discussions.microsoft.com> wrote in message news:A8F53145-85D5-49C8-BD99-2347EFF30B9D@microsoft.com... > Here is my update statement, > strSQL = "UPDATE dndusers SET Active = Yes WHERE E_Mail='" & > Request.QueryString("email") & "' AND Activation_Code = " & > fRandomPassword & > ";" >
What SQL does this produce?
I tried both UPDATE dndusers SET Active = 1 WHERE E_Mail='test2005@canada.com' AND Activation_Code = 'lnuqxynzoe'; and UPDATE dndusers SET Active = 1 WHERE E_Mail='test2005@canada.com' AND Activation_Code = lnuqxynzoe; [quoted text, click to view] "CJM" wrote: > > "Joe" <Joe@discussions.microsoft.com> wrote in message > news:A8F53145-85D5-49C8-BD99-2347EFF30B9D@microsoft.com... > > Here is my update statement, > > strSQL = "UPDATE dndusers SET Active = Yes WHERE E_Mail='" & > > Request.QueryString("email") & "' AND Activation_Code = " & > > fRandomPassword & > > ";" > > > > What SQL does this produce? > >
Don't use "yes." That word means nothing. Use true or false, or 1 or 0 (preferred). strSQL = "UPDATE dndusers SET Active = 1 WHERE ...." Ray at work [quoted text, click to view] "Joe" <Joe@discussions.microsoft.com> wrote in message news:A8F53145-85D5-49C8-BD99-2347EFF30B9D@microsoft.com... > Hi, > > I have a "Yes/No" data field in MS Access database that I am trying to > update. Here is my update statement, > strSQL = "UPDATE dndusers SET Active = Yes WHERE E_Mail='" & > Request.QueryString("email") & "' AND Activation_Code = " & fRandomPassword & > ";" > > I get an error message saying "No value given for one or more required > parameters" and points to ".Execute" line. > > Here is my code. > > I have never worked with "Yes/No" data field before and when I print the > strSQL, I see all the variables have values. Can someone tell me why I am > getting this error? > > Thanks for your time. > > Joe > > Dim objConn > Dim objRS > Dim bUserExist > > bUserExist = FALSE > > Set objConn = Server.CreateObject("ADODB.Connection") > objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _ > "Data Source=E:\test\databases\test.mdb;" > > Set objRS=Server.CreateObject("ADODB.Recordset") > strSQL = "SELECT * FROM dndusers " & "WHERE E_Mail='" & > Request.QueryString("email") & "' AND Activation_Code = '" & > Request.QueryString("activatecode") & "';" > objRS.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly, adCmdText > > If Not objRS.EOF And Not objRS.BOF Then > bUserExist = TRUE > strSQL = "UPDATE dndusers SET Active = Yes WHERE E_Mail='" & > Request.QueryString("email") & "' AND Activation_Code = " & fRandomPassword & > ";" > Set updateCmd = Server.CreateObject("ADODB.Command") > With updateCmd > .ActiveConnection = objConn > .CommandText = strSQL > .Execute > End With > objRS.Close() >
Tried that as well. Then I don't get any error, but when I open the access DB, I don't see any updated doen in Active field. UPDATE dndusers SET Active = 1 WHERE E_Mail='test2005@canada.com' AND Activation_Code = 'lnuqxynzoe'; Joe [quoted text, click to view] "Ray Costanzo [MVP]" wrote: > Your Activation_Code value needs to be delimited in ' as well. > > Ray at work > > "Joe" <Joe@discussions.microsoft.com> wrote in message > news:4D910550-AA8C-4312-92A4-50CAB9718407@microsoft.com... > > Even 1 and 0 doesn't work, I get following error, > > > > Microsoft JET Database Engine error '80040e10' > > > > No value given for one or more required parameters. > > > > /customerportal2/dnd/activate.asp, line 61 > > > > The line 61 is '.Execute'. > > > > With updateCmd > > .ActiveConnection = objConn > > .CommandText = strSQL > > .Execute > > End With > > > > > > This is not realted to write permission beacsue I can insert record in > this > > database witout any problem. > > > > The SQL statement is, > > > > UPDATE dndusers SET Active = 1 WHERE E_Mail='test2005@canada.com' AND > > Activation_Code = lnuqxynzoe; > > > > > > > > > > > > > > "Ray Costanzo [MVP]" wrote: > > > > > Don't use "yes." That word means nothing. Use true or false, or 1 or 0 > > > (preferred). > > > > > > strSQL = "UPDATE dndusers SET Active = 1 WHERE ...." > > > > > > Ray at work > > > > > > "Joe" <Joe@discussions.microsoft.com> wrote in message > > > news:A8F53145-85D5-49C8-BD99-2347EFF30B9D@microsoft.com... > > > > Hi, > > > > > > > > I have a "Yes/No" data field in MS Access database that I am trying to > > > > update. Here is my update statement, > > > > strSQL = "UPDATE dndusers SET Active = Yes WHERE E_Mail='" & > > > > Request.QueryString("email") & "' AND Activation_Code = " & > > > fRandomPassword & > > > > ";" > > > > > > > > I get an error message saying "No value given for one or more required > > > > parameters" and points to ".Execute" line. > > > > > > > > Here is my code. > > > > > > > > I have never worked with "Yes/No" data field before and when I print > the > > > > strSQL, I see all the variables have values. Can someone tell me why I > am > > > > getting this error? > > > > > > > > Thanks for your time. > > > > > > > > Joe > > > > > > > > Dim objConn > > > > Dim objRS > > > > Dim bUserExist > > > > > > > > bUserExist = FALSE > > > > > > > > Set objConn = Server.CreateObject("ADODB.Connection") > > > > objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _ > > > > "Data Source=E:\test\databases\test.mdb;" > > > > > > > > Set objRS=Server.CreateObject("ADODB.Recordset") > > > > strSQL = "SELECT * FROM dndusers " & "WHERE E_Mail='" & > > > > Request.QueryString("email") & "' AND Activation_Code = '" & > > > > Request.QueryString("activatecode") & "';" > > > > objRS.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly, > adCmdText > > > > > > > > If Not objRS.EOF And Not objRS.BOF Then > > > > bUserExist = TRUE > > > > strSQL = "UPDATE dndusers SET Active = Yes WHERE E_Mail='" & > > > > Request.QueryString("email") & "' AND Activation_Code = " & > > > fRandomPassword & > > > > ";" > > > > Set updateCmd = Server.CreateObject("ADODB.Command") > > > > With updateCmd > > > > .ActiveConnection = objConn > > > > .CommandText = strSQL > > > > .Execute > > > > End With > > > > objRS.Close() > > > > > > > > > > > > > > >
Yes I do have matching record. For some reason with Activation_code delimited in ', I don't get any error but Active field realted to this WHERE clause doesn't change. By default Active is not seclected in DB meaning it is empty. I want to set it to Yes. Joe [quoted text, click to view] "Ray Costanzo [MVP]" wrote: > So, do you have any records that meet that WHERE clause? > > SELECT * from dndusers WHERE E_Mail='test2005@canada.com' AND > Activation_Code = 'lnuqxynzoe' > > Ray at work > > > Does that return anything? If not, that would tell you why nothing > "Joe" <Joe@discussions.microsoft.com> wrote in message > news:E34F9645-CEDE-45E3-9775-4C6A38963A92@microsoft.com... > > Tried that as well. Then I don't get any error, but when I open the access > > DB, I don't see any updated doen in Active field. > > > > UPDATE dndusers SET Active = 1 WHERE E_Mail='test2005@canada.com' AND > > Activation_Code = 'lnuqxynzoe'; > > > > Joe > > > > > > > > "Ray Costanzo [MVP]" wrote: > > > > > Your Activation_Code value needs to be delimited in ' as well. > > > > > > Ray at work > > > > > > "Joe" <Joe@discussions.microsoft.com> wrote in message > > > news:4D910550-AA8C-4312-92A4-50CAB9718407@microsoft.com... > > > > Even 1 and 0 doesn't work, I get following error, > > > > > > > > Microsoft JET Database Engine error '80040e10' > > > > > > > > No value given for one or more required parameters. > > > > > > > > /customerportal2/dnd/activate.asp, line 61 > > > > > > > > The line 61 is '.Execute'. > > > > > > > > With updateCmd > > > > .ActiveConnection = objConn > > > > .CommandText = strSQL > > > > .Execute > > > > End With > > > > > > > > > > > > This is not realted to write permission beacsue I can insert record in > > > this > > > > database witout any problem. > > > > > > > > The SQL statement is, > > > > > > > > UPDATE dndusers SET Active = 1 WHERE E_Mail='test2005@canada.com' AND > > > > Activation_Code = lnuqxynzoe; > > > > > > > > > > > > > > > > > > > > > > > > > > > > "Ray Costanzo [MVP]" wrote: > > > > > > > > > Don't use "yes." That word means nothing. Use true or false, or 1 > or 0 > > > > > (preferred). > > > > > > > > > > strSQL = "UPDATE dndusers SET Active = 1 WHERE ...." > > > > > > > > > > Ray at work > > > > > > > > > > "Joe" <Joe@discussions.microsoft.com> wrote in message > > > > > news:A8F53145-85D5-49C8-BD99-2347EFF30B9D@microsoft.com... > > > > > > Hi, > > > > > > > > > > > > I have a "Yes/No" data field in MS Access database that I am > trying to > > > > > > update. Here is my update statement, > > > > > > strSQL = "UPDATE dndusers SET Active = Yes WHERE E_Mail='" & > > > > > > Request.QueryString("email") & "' AND Activation_Code = " & > > > > > fRandomPassword & > > > > > > ";" > > > > > > > > > > > > I get an error message saying "No value given for one or more > required > > > > > > parameters" and points to ".Execute" line. > > > > > > > > > > > > Here is my code. > > > > > > > > > > > > I have never worked with "Yes/No" data field before and when I > print > > > the > > > > > > strSQL, I see all the variables have values. Can someone tell me > why I > > > am > > > > > > getting this error? > > > > > > > > > > > > Thanks for your time. > > > > > > > > > > > > Joe > > > > > > > > > > > > Dim objConn > > > > > > Dim objRS > > > > > > Dim bUserExist > > > > > > > > > > > > bUserExist = FALSE > > > > > > > > > > > > Set objConn = Server.CreateObject("ADODB.Connection") > > > > > > objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _ > > > > > > "Data Source=E:\test\databases\test.mdb;" > > > > > > > > > > > > Set objRS=Server.CreateObject("ADODB.Recordset") > > > > > > strSQL = "SELECT * FROM dndusers " & "WHERE E_Mail='" & > > > > > > Request.QueryString("email") & "' AND Activation_Code = '" & > > > > > > Request.QueryString("activatecode") & "';" > > > > > > objRS.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly, > > > adCmdText > > > > > > > > > > > > If Not objRS.EOF And Not objRS.BOF Then > > > > > > bUserExist = TRUE > > > > > > strSQL = "UPDATE dndusers SET Active = Yes WHERE E_Mail='" & > > > > > > Request.QueryString("email") & "' AND Activation_Code = " & > > > > > fRandomPassword & > > > > > > ";" > > > > > > Set updateCmd = Server.CreateObject("ADODB.Command") > > > > > > With updateCmd > > > > > > .ActiveConnection = objConn > > > > > > .CommandText = strSQL > > > > > > .Execute > > > > > > End With > > > > > > objRS.Close() > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Your Activation_Code value needs to be delimited in ' as well. Ray at work [quoted text, click to view] "Joe" <Joe@discussions.microsoft.com> wrote in message news:4D910550-AA8C-4312-92A4-50CAB9718407@microsoft.com... > Even 1 and 0 doesn't work, I get following error, > > Microsoft JET Database Engine error '80040e10' > > No value given for one or more required parameters. > > /customerportal2/dnd/activate.asp, line 61 > > The line 61 is '.Execute'. > > With updateCmd > .ActiveConnection = objConn > .CommandText = strSQL > .Execute > End With > > > This is not realted to write permission beacsue I can insert record in this > database witout any problem. > > The SQL statement is, > > UPDATE dndusers SET Active = 1 WHERE E_Mail='test2005@canada.com' AND > Activation_Code = lnuqxynzoe; > > > > > > > "Ray Costanzo [MVP]" wrote: > > > Don't use "yes." That word means nothing. Use true or false, or 1 or 0 > > (preferred). > > > > strSQL = "UPDATE dndusers SET Active = 1 WHERE ...." > > > > Ray at work > > > > "Joe" <Joe@discussions.microsoft.com> wrote in message > > news:A8F53145-85D5-49C8-BD99-2347EFF30B9D@microsoft.com... > > > Hi, > > > > > > I have a "Yes/No" data field in MS Access database that I am trying to > > > update. Here is my update statement, > > > strSQL = "UPDATE dndusers SET Active = Yes WHERE E_Mail='" & > > > Request.QueryString("email") & "' AND Activation_Code = " & > > fRandomPassword & > > > ";" > > > > > > I get an error message saying "No value given for one or more required > > > parameters" and points to ".Execute" line. > > > > > > Here is my code. > > > > > > I have never worked with "Yes/No" data field before and when I print the > > > strSQL, I see all the variables have values. Can someone tell me why I am > > > getting this error? > > > > > > Thanks for your time. > > > > > > Joe > > > > > > Dim objConn > > > Dim objRS > > > Dim bUserExist > > > > > > bUserExist = FALSE > > > > > > Set objConn = Server.CreateObject("ADODB.Connection") > > > objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _ > > > "Data Source=E:\test\databases\test.mdb;" > > > > > > Set objRS=Server.CreateObject("ADODB.Recordset") > > > strSQL = "SELECT * FROM dndusers " & "WHERE E_Mail='" & > > > Request.QueryString("email") & "' AND Activation_Code = '" & > > > Request.QueryString("activatecode") & "';" > > > objRS.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly, adCmdText > > > > > > If Not objRS.EOF And Not objRS.BOF Then > > > bUserExist = TRUE > > > strSQL = "UPDATE dndusers SET Active = Yes WHERE E_Mail='" & > > > Request.QueryString("email") & "' AND Activation_Code = " & > > fRandomPassword & > > > ";" > > > Set updateCmd = Server.CreateObject("ADODB.Command") > > > With updateCmd > > > .ActiveConnection = objConn > > > .CommandText = strSQL > > > .Execute > > > End With > > > objRS.Close() > > > > > > > > >
So, do you have any records that meet that WHERE clause? SELECT * from dndusers WHERE E_Mail='test2005@canada.com' AND Activation_Code = 'lnuqxynzoe' Ray at work Does that return anything? If not, that would tell you why nothing [quoted text, click to view] "Joe" <Joe@discussions.microsoft.com> wrote in message news:E34F9645-CEDE-45E3-9775-4C6A38963A92@microsoft.com... > Tried that as well. Then I don't get any error, but when I open the access > DB, I don't see any updated doen in Active field. > > UPDATE dndusers SET Active = 1 WHERE E_Mail='test2005@canada.com' AND > Activation_Code = 'lnuqxynzoe'; > > Joe > > > > "Ray Costanzo [MVP]" wrote: > > > Your Activation_Code value needs to be delimited in ' as well. > > > > Ray at work > > > > "Joe" <Joe@discussions.microsoft.com> wrote in message > > news:4D910550-AA8C-4312-92A4-50CAB9718407@microsoft.com... > > > Even 1 and 0 doesn't work, I get following error, > > > > > > Microsoft JET Database Engine error '80040e10' > > > > > > No value given for one or more required parameters. > > > > > > /customerportal2/dnd/activate.asp, line 61 > > > > > > The line 61 is '.Execute'. > > > > > > With updateCmd > > > .ActiveConnection = objConn > > > .CommandText = strSQL > > > .Execute > > > End With > > > > > > > > > This is not realted to write permission beacsue I can insert record in > > this > > > database witout any problem. > > > > > > The SQL statement is, > > > > > > UPDATE dndusers SET Active = 1 WHERE E_Mail='test2005@canada.com' AND > > > Activation_Code = lnuqxynzoe; > > > > > > > > > > > > > > > > > > > > > "Ray Costanzo [MVP]" wrote: > > > > > > > Don't use "yes." That word means nothing. Use true or false, or 1 or 0 > > > > (preferred). > > > > > > > > strSQL = "UPDATE dndusers SET Active = 1 WHERE ...." > > > > > > > > Ray at work > > > > > > > > "Joe" <Joe@discussions.microsoft.com> wrote in message > > > > news:A8F53145-85D5-49C8-BD99-2347EFF30B9D@microsoft.com... > > > > > Hi, > > > > > > > > > > I have a "Yes/No" data field in MS Access database that I am trying to > > > > > update. Here is my update statement, > > > > > strSQL = "UPDATE dndusers SET Active = Yes WHERE E_Mail='" & > > > > > Request.QueryString("email") & "' AND Activation_Code = " & > > > > fRandomPassword & > > > > > ";" > > > > > > > > > > I get an error message saying "No value given for one or more required > > > > > parameters" and points to ".Execute" line. > > > > > > > > > > Here is my code. > > > > > > > > > > I have never worked with "Yes/No" data field before and when I print > > the > > > > > strSQL, I see all the variables have values. Can someone tell me why I > > am > > > > > getting this error? > > > > > > > > > > Thanks for your time. > > > > > > > > > > Joe > > > > > > > > > > Dim objConn > > > > > Dim objRS > > > > > Dim bUserExist > > > > > > > > > > bUserExist = FALSE > > > > > > > > > > Set objConn = Server.CreateObject("ADODB.Connection") > > > > > objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _ > > > > > "Data Source=E:\test\databases\test.mdb;" > > > > > > > > > > Set objRS=Server.CreateObject("ADODB.Recordset") > > > > > strSQL = "SELECT * FROM dndusers " & "WHERE E_Mail='" & > > > > > Request.QueryString("email") & "' AND Activation_Code = '" & > > > > > Request.QueryString("activatecode") & "';" > > > > > objRS.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly, > > adCmdText > > > > > > > > > > If Not objRS.EOF And Not objRS.BOF Then > > > > > bUserExist = TRUE > > > > > strSQL = "UPDATE dndusers SET Active = Yes WHERE E_Mail='" & > > > > > Request.QueryString("email") & "' AND Activation_Code = " & > > > > fRandomPassword & > > > > > ";" > > > > > Set updateCmd = Server.CreateObject("ADODB.Command") > > > > > With updateCmd > > > > > .ActiveConnection = objConn > > > > > .CommandText = strSQL > > > > > .Execute > > > > > End With > > > > > objRS.Close() > > > > > > > > > > > > > > > > > > > > > > >
Please post your new and updated code that you're using now. Ray at home [quoted text, click to view] "Joe" <Joe@discussions.microsoft.com> wrote in message news:FFA7B26B-5DC8-4334-99D0-6E9993D8E094@microsoft.com... > Yes I do have matching record. For some reason with Activation_code > delimited in ', I don't get any error but Active field realted to this > WHERE > clause doesn't change. By default Active is not seclected in DB meaning it > is > empty. I want to set it to Yes. > > Joe > > > > "Ray Costanzo [MVP]" wrote: > >> So, do you have any records that meet that WHERE clause? >> >> SELECT * from dndusers WHERE E_Mail='test2005@canada.com' AND >> Activation_Code = 'lnuqxynzoe' >> >> Ray at work >> >>
Try UPDATE dndusers SET [Active] = 1 WHERE E_Mail='test2005@canada.com' AND Activation_Code = 'lnuqxynzoe' rgds dave [quoted text, click to view] "Joe" <Joe@discussions.microsoft.com> wrote in message news:E34F9645-CEDE-45E3-9775-4C6A38963A92@microsoft.com... > Tried that as well. Then I don't get any error, but when I open the access > DB, I don't see any updated doen in Active field. > > UPDATE dndusers SET Active = 1 WHERE E_Mail='test2005@canada.com' AND > Activation_Code = 'lnuqxynzoe'; > > Joe > > > > "Ray Costanzo [MVP]" wrote: > >> Your Activation_Code value needs to be delimited in ' as well. >> >> Ray at work >> >> "Joe" <Joe@discussions.microsoft.com> wrote in message >> news:4D910550-AA8C-4312-92A4-50CAB9718407@microsoft.com... >> > Even 1 and 0 doesn't work, I get following error, >> > >> > Microsoft JET Database Engine error '80040e10' >> > >> > No value given for one or more required parameters. >> > >> > /customerportal2/dnd/activate.asp, line 61 >> > >> > The line 61 is '.Execute'. >> > >> > With updateCmd >> > .ActiveConnection = objConn >> > .CommandText = strSQL >> > .Execute >> > End With >> > >> > >> > This is not realted to write permission beacsue I can insert record in >> this >> > database witout any problem. >> > >> > The SQL statement is, >> > >> > UPDATE dndusers SET Active = 1 WHERE E_Mail='test2005@canada.com' AND >> > Activation_Code = lnuqxynzoe; >> > >> > >> > >> > >> > >> > >> > "Ray Costanzo [MVP]" wrote: >> > >> > > Don't use "yes." That word means nothing. Use true or false, or 1 >> > > or 0 >> > > (preferred). >> > > >> > > strSQL = "UPDATE dndusers SET Active = 1 WHERE ...." >> > > >> > > Ray at work >> > > >> > > "Joe" <Joe@discussions.microsoft.com> wrote in message >> > > news:A8F53145-85D5-49C8-BD99-2347EFF30B9D@microsoft.com... >> > > > Hi, >> > > > >> > > > I have a "Yes/No" data field in MS Access database that I am trying >> > > > to >> > > > update. Here is my update statement, >> > > > strSQL = "UPDATE dndusers SET Active = Yes WHERE E_Mail='" & >> > > > Request.QueryString("email") & "' AND Activation_Code = " & >> > > fRandomPassword & >> > > > ";" >> > > > >> > > > I get an error message saying "No value given for one or more >> > > > required >> > > > parameters" and points to ".Execute" line. >> > > > >> > > > Here is my code. >> > > > >> > > > I have never worked with "Yes/No" data field before and when I >> > > > print >> the >> > > > strSQL, I see all the variables have values. Can someone tell me >> > > > why I >> am >> > > > getting this error? >> > > > >> > > > Thanks for your time. >> > > > >> > > > Joe >> > > > >> > > > Dim objConn >> > > > Dim objRS >> > > > Dim bUserExist >> > > > >> > > > bUserExist = FALSE >> > > > >> > > > Set objConn = Server.CreateObject("ADODB.Connection") >> > > > objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _ >> > > > "Data Source=E:\test\databases\test.mdb;" >> > > > >> > > > Set objRS=Server.CreateObject("ADODB.Recordset") >> > > > strSQL = "SELECT * FROM dndusers " & "WHERE E_Mail='" & >> > > > Request.QueryString("email") & "' AND Activation_Code = '" & >> > > > Request.QueryString("activatecode") & "';" >> > > > objRS.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly, >> adCmdText >> > > > >> > > > If Not objRS.EOF And Not objRS.BOF Then >> > > > bUserExist = TRUE >> > > > strSQL = "UPDATE dndusers SET Active = Yes WHERE E_Mail='" & >> > > > Request.QueryString("email") & "' AND Activation_Code = " & >> > > fRandomPassword & >> > > > ";" >> > > > Set updateCmd = Server.CreateObject("ADODB.Command") >> > > > With updateCmd >> > > > .ActiveConnection = objConn >> > > > .CommandText = strSQL >> > > > .Execute >> > > > End With >> > > > objRS.Close() >> > > > >> > > >> > > >> > > >> >> >>
Two problems with this: 1. It's a month late ;-) 2. Unless Active is a Number field, 0 or -1 would be more appropriate alternatives for its value. [quoted text, click to view] dave wrote: > Try > > UPDATE dndusers SET [Active] = 1 WHERE E_Mail='test2005@canada.com' > AND Activation_Code = 'lnuqxynzoe' > > rgds > dave > > "Joe" <Joe@discussions.microsoft.com> wrote in message > news:E34F9645-CEDE-45E3-9775-4C6A38963A92@microsoft.com... >> Tried that as well. Then I don't get any error, but when I open the >> access DB, I don't see any updated doen in Active field. >> >> UPDATE dndusers SET Active = 1 WHERE E_Mail='test2005@canada.com' AND >> Activation_Code = 'lnuqxynzoe'; >> >> Joe >> >> >> >> "Ray Costanzo [MVP]" wrote: >> >>> Your Activation_Code value needs to be delimited in ' as well. >>> >>> Ray at work >>> >>> "Joe" <Joe@discussions.microsoft.com> wrote in message >>> news:4D910550-AA8C-4312-92A4-50CAB9718407@microsoft.com... >>>> Even 1 and 0 doesn't work, I get following error, >>>> >>>> Microsoft JET Database Engine error '80040e10' >>>> >>>> No value given for one or more required parameters. >>>> >>>> /customerportal2/dnd/activate.asp, line 61 >>>> >>>> The line 61 is '.Execute'. >>>> >>>> With updateCmd >>>> .ActiveConnection = objConn >>>> .CommandText = strSQL >>>> .Execute >>>> End With >>>> >>>> >>>> This is not realted to write permission beacsue I can insert >>>> record in this database witout any problem. >>>> >>>> The SQL statement is, >>>> >>>> UPDATE dndusers SET Active = 1 WHERE E_Mail='test2005@canada.com' >>>> AND Activation_Code = lnuqxynzoe; >>>> >>>> >>>> >>>> >>>> >>>> >>>> "Ray Costanzo [MVP]" wrote: >>>> >>>>> Don't use "yes." That word means nothing. Use true or false, or >>>>> 1 or 0 >>>>> (preferred). >>>>> >>>>> strSQL = "UPDATE dndusers SET Active = 1 WHERE ...." >>>>> >>>>> Ray at work >>>>> >>>>> "Joe" <Joe@discussions.microsoft.com> wrote in message >>>>> news:A8F53145-85D5-49C8-BD99-2347EFF30B9D@microsoft.com... >>>>>> Hi, >>>>>> >>>>>> I have a "Yes/No" data field in MS Access database that I am >>>>>> trying to >>>>>> update. Here is my update statement, >>>>>> strSQL = "UPDATE dndusers SET Active = Yes WHERE E_Mail='" & >>>>>> Request.QueryString("email") & "' AND Activation_Code = " & >>>>>> fRandomPassword & ";" >>>>>> >>>>>> I get an error message saying "No value given for one or more >>>>>> required >>>>>> parameters" and points to ".Execute" line. >>>>>> >>>>>> Here is my code. >>>>>> >>>>>> I have never worked with "Yes/No" data field before and when I >>>>>> print >>> the >>>>>> strSQL, I see all the variables have values. Can someone tell me >>>>>> why I >>> am >>>>>> getting this error? >>>>>> >>>>>> Thanks for your time. >>>>>> >>>>>> Joe >>>>>> >>>>>> Dim objConn >>>>>> Dim objRS >>>>>> Dim bUserExist >>>>>> >>>>>> bUserExist = FALSE >>>>>> >>>>>> Set objConn = Server.CreateObject("ADODB.Connection") >>>>>> objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _ >>>>>> "Data Source=E:\test\databases\test.mdb;" >>>>>> >>>>>> Set objRS=Server.CreateObject("ADODB.Recordset") >>>>>> strSQL = "SELECT * FROM dndusers " & "WHERE E_Mail='" & >>>>>> Request.QueryString("email") & "' AND Activation_Code = '" & >>>>>> Request.QueryString("activatecode") & "';" >>>>>> objRS.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly, >>>>>> adCmdText If Not objRS.EOF And Not objRS.BOF Then >>>>>> bUserExist = TRUE >>>>>> strSQL = "UPDATE dndusers SET Active = Yes WHERE E_Mail='" & >>>>>> Request.QueryString("email") & "' AND Activation_Code = " & >>>>>> fRandomPassword & ";" >>>>>> Set updateCmd = Server.CreateObject("ADODB.Command") >>>>>> With updateCmd >>>>>> .ActiveConnection = objConn >>>>>> .CommandText = strSQL >>>>>> .Execute >>>>>> End With >>>>>> objRS.Close()
-- Microsoft MVP - ASP/ASP.NET Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM"
Don't see what you're looking for? Try a search.
|
|
|