 |
 |

10-04-2002, 02:38 AM
|
|
Freshman
|
|
Join Date: Oct 2002
Posts: 40
|
|
update recordset error
|
I am totally stumped on this one. Please, God, help me:
I have a set of code which updates an underlying Access table. I swear that I have seen it work in one place, then in another it will give me error numbers -2147467259 or -2147217864, with the cryptic messages that the "operation must use an updatable query" or "not enough base table information". Here's a sample of code:
Adodc1.Refresh
Adodc1.Recordset.MoveFirst
While (Not Adodc1.Recordset.EOF)
With Adodc1.Recordset
If intdummy = !scode Then
If Int(!CandNo) Mod Int(Text1.text) = 0 Then
intRoom = intRoom + 1
End If
If !CandNo < 226 Then
!Room = "0" & intRoom
Else
!Room = intRoom
End If
.Update
.MoveNext
Else
intRoom = 1
intdummy = !scode
End If
End With
Wend
All this does is put a bunch of people into different "rooms" based on group size defined by the user (text1.text). But it ALWAYS gets stuck on .Update. Why? I'm going crazy!
|
|

10-04-2002, 02:51 AM
|
|
Centurion
|
|
Join Date: Jul 2002
Location: -
Posts: 152
|
|
Check if there is a value there for updating... Do u understand?
try using breakpoint to see if there is value for
Code:
If !CandNo < 226 Then
!Room = "0" & intRoom
Else
!Room = intRoom
End If
check !room etc.
if there is no vlaue, how can it update...
and one more thing.... make sure that the data type in the database is an "number"
Let's see wht's the problem will be
|
|

10-04-2002, 03:30 AM
|
|
Freshman
|
|
Join Date: Oct 2002
Posts: 40
|
|
|
no, didn't work. all variables have values. sorry about the confusion with the dimension.... introom is actually a string variable. !room writes to a text field.
i'm telling you, this one is crazy!
|
|

10-04-2002, 07:02 AM
|
 |
Contributor
|
|
Join Date: Aug 2002
Location: Iowa
Posts: 450
|
|
|
It seems as if your settings might be for read-only, if you take the error message literally??? Check your properties in the adodc control...better yet, write code without the data control.
Hope this helps.
|
|

10-04-2002, 09:28 AM
|
|
|
There could be a few problems here. If your ADO Recordsource is a query, with joins that have no real PK in either of the tables, it will be a read only query regardless of the adodc settings.
Use:
Code:
Msgbox .Supports( adUpdate)
To determine if the recordset itself can perform an update. If not... there's your answer. If so... come on back.
|
|

10-04-2002, 10:22 AM
|
 |
Mexican Coder
|
|
Join Date: Jun 2002
Location: Monterrey, N.L., Mexico
Posts: 2,793
|
|
|
Where is the Adodc1.Recordset.AddNew ???
|
__________________
Mikecrosoft.NET
* If I stop to ask I will stop to learn
* Just I know that I don't know nothing
|

05-30-2003, 11:57 AM
|
|
Newcomer
|
|
Join Date: May 2003
Posts: 1
|
|
'must use an updatable query'
This message is normally caused (from VB) by trying to do something to a DB that has been opened in 'Read' instead of 'ReadWrite' mode.
That's normally set in the DB connect string.
Quote: Originally Posted by pleth I am totally stumped on this one. Please, God, help me:
I have a set of code which updates an underlying Access table. I swear that I have seen it work in one place, then in another it will give me error numbers -2147467259 or -2147217864, with the cryptic messages that the "operation must use an updatable query" or "not enough base table information". Here's a sample of code:
Adodc1.Refresh
Adodc1.Recordset.MoveFirst
While (Not Adodc1.Recordset.EOF)
With Adodc1.Recordset
If intdummy = !scode Then
If Int(!CandNo) Mod Int(Text1.text) = 0 Then
intRoom = intRoom + 1
End If
If !CandNo < 226 Then
!Room = "0" & intRoom
Else
!Room = intRoom
End If
.Update
.MoveNext
Else
intRoom = 1
intdummy = !scode
End If
End With
Wend
All this does is put a bunch of people into different "rooms" based on group size defined by the user (text1.text). But it ALWAYS gets stuck on .Update. Why? I'm going crazy!
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
 |
|