No value given for one or more required parameters?

Ace_sq
04-19-2004, 03:46 PM
Okay, in this I am trying to set a YES/NO tick to no. Dog is a table, DogID is a field, DisplayDogID is a label.

I enter the following code:

Set rs7 = New ADODB.Recordset
rs7.Open "select * from Dog where DogID=DisplayDogID", db, adOpenStatic, adLockOptimistic
rs7!InKennel = 0

Activating this, I get the error "Run-time error '-2147217904 (80040e10)': No value given for one or more required parameters", dubug highlighting the Open line.


Can anyone help me?

MKoslof
04-19-2004, 03:50 PM
Is DogID a numerical field or a string field. If numerical, use the format below. And is "db" an ADODB connection? If so, have you defined it and opened it properly?



Dim sSQL as string

sSQL = "SELECT * FROM Dog WHERE DogID =" & DisplayDogID

rs7.Open sSQL, db, adOpenStatic, adLockOptimistic, adCmdText

webbone
04-19-2004, 03:51 PM
You will need your SQL to be like this:

"select * from Dog where DogID='" & DisplayDogID.Caption & "'"

Ace_sq
04-19-2004, 04:22 PM
Okay, that works thanks, changing it to WHERE DogID =" & DisplayDogID.


I have another problem now though. I changed the YES/NO tickbox to text, so the third line now goes:

rs5!InKennel = "No"


However, this doesn't actually add it to my table. Where did I go wrong?

MKoslof
04-19-2004, 04:27 PM
Try to use 1 or 0 for your true/false values. These are the bitwise comparisons. Now, if the fields on your table are STRINGS, you need to pass a string value. If the fields on your table are bit-wise (yes, no, true false) try the 0/1 method.

Ace_sq
04-19-2004, 04:36 PM
Wouldnt rs5!InKennel = "No" be a string value?

MKoslof
04-19-2004, 07:47 PM
What is "InKennel" defined as? If this FIELD on the TABLE is defined as a string, then yes. If it is defined as a boolean type (Yes/NO, tru/false) then No it wouldn't be.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum