Newbie needs help with “yes/noâ€Â
Newbie needs help with “yes/noâ€Â
am 26.07.2005 23:57:01 von joe
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()
Re: Newbie needs help with "yes/no" field
am 27.07.2005 11:04:12 von CJM
"Joe" 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?
Re: Newbie needs help with "yes/no" field
am 27.07.2005 16:48:14 von unknown
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" 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()
>
Re: Newbie needs help with "yes/no" field
am 27.07.2005 18:43:04 von joe
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" 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()
> >
>
>
>
Re: Newbie needs help with "yes/no" field
am 27.07.2005 19:11:02 von joe
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;
"CJM" wrote:
>
> "Joe" 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?
>
>
>
Re: Newbie needs help with "yes/no" field
am 27.07.2005 20:09:21 von unknown
Your Activation_Code value needs to be delimited in ' as well.
Ray at work
"Joe" 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" 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()
> > >
> >
> >
> >
Re: Newbie needs help with "yes/no" field
am 27.07.2005 20:19:05 von joe
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" 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" 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()
> > > >
> > >
> > >
> > >
>
>
>
Re: Newbie needs help with "yes/no" field
am 27.07.2005 20:22:42 von unknown
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" 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" 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" 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()
> > > > >
> > > >
> > > >
> > > >
> >
> >
> >
Re: Newbie needs help with "yes/no" field
am 27.07.2005 20:36:12 von joe
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
>
>
> Does that return anything? If not, that would tell you why nothing
> "Joe" 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" 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" 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()
> > > > > >
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>
>
Re: Newbie needs help with "yes/no" field
am 28.07.2005 02:33:43 von unknown
Please post your new and updated code that you're using now.
Ray at home
"Joe" 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
>>
>>
Re: Newbie needs help with "yes/no" field
am 30.08.2005 03:10:19 von dave
Try
UPDATE dndusers SET [Active] = 1 WHERE E_Mail='test2005@canada.com' AND
Activation_Code = 'lnuqxynzoe'
rgds
dave
"Joe" 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" 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" 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()
>> > > >
>> > >
>> > >
>> > >
>>
>>
>>
Re: Newbie needs help with "yes/no" field
am 30.08.2005 06:47:00 von reb01501
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.
dave wrote:
> Try
>
> UPDATE dndusers SET [Active] = 1 WHERE E_Mail='test2005@canada.com'
> AND Activation_Code = 'lnuqxynzoe'
>
> rgds
> dave
>
> "Joe" 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" 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" 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"