-
Updating an ADO Recordset
I am tying to update an ADO recordset and I keep getting an error -2147467259,
Insufficient key column information for updating or refreshing.
Here is my recordset open:
adoActualRS.Open AQuery, ab, adOpenStatic, adLockOptimistic
and the update statement:
adoActualRS!TotalYearASP = BudASP
adoActualRS![2000PlanTons] = BudTon
adoActualRS.Update
Any ideas as to why it isn't working??
-
Re: Updating an ADO Recordset
"Craig" <craig.bielefeld@martinmarietta.com> wrote:
>
>I am tying to update an ADO recordset and I keep getting an error -2147467259,
>Insufficient key column information for updating or refreshing.
>
>Here is my recordset open:
>adoActualRS.Open AQuery, ab, adOpenStatic, adLockOptimistic
>
>and the update statement:
>adoActualRS!TotalYearASP = BudASP
>adoActualRS![2000PlanTons] = BudTon
>adoActualRS.Update
>
>Any ideas as to why it isn't working??
>
Craig,
It looks to me like the source of your problem lies in the connectstring
property of your connection most likely.
-
Re: Updating an ADO Recordset
"Craig" <craig.bielefeld@martinmarietta.com> wrote:
>
>I am tying to update an ADO recordset and I keep getting an error -2147467259,
>Insufficient key column information for updating or refreshing.
>
>Here is my recordset open:
>adoActualRS.Open AQuery, ab, adOpenStatic, adLockOptimistic
>
>and the update statement:
>adoActualRS!TotalYearASP = BudASP
>adoActualRS![2000PlanTons] = BudTon
>adoActualRS.Update
>
>Any ideas as to why it isn't work
Instead of parameter adOpenStatic, You should use: adOpenKeyset.
-
Re: Updating an ADO Recordset
"Marko Sink" <mare.sink@mailcity.com> wrote:
>
>"Craig" <craig.bielefeld@martinmarietta.com> wrote:
>>
>>I am tying to update an ADO recordset and I keep getting an error -2147467259,
>>Insufficient key column information for updating or refreshing.
>>
>>Here is my recordset open:
>>adoActualRS.Open AQuery, ab, adOpenStatic, adLockOptimistic
>>
>>and the update statement:
>>adoActualRS!TotalYearASP = BudASP
>>adoActualRS![2000PlanTons] = BudTon
>>adoActualRS.Update
>>
>>Any ideas as to why it isn't work
>
>Instead of parameter adOpenStatic, You should use: adOpenKeyset.
>
I tried that and I still get the same error message.
I am just trying to update two fields in the recordset.
-
Re: Updating an ADO Recordset
"Marky Mark" <mew@home.com> wrote:
>
>"Craig" <craig.bielefeld@martinmarietta.com> wrote:
>>
>>I am tying to update an ADO recordset and I keep getting an error -2147467259,
>>Insufficient key column information for updating or refreshing.
>>
>>Here is my recordset open:
>>adoActualRS.Open AQuery, ab, adOpenStatic, adLockOptimistic
>>
>>and the update statement:
>>adoActualRS!TotalYearASP = BudASP
>>adoActualRS![2000PlanTons] = BudTon
>>adoActualRS.Update
>>
>>Any ideas as to why it isn't working??
>>
>
>
>Craig,
>
> It looks to me like the source of your problem lies in the connectstring
>property of your connection most likely.
Here is how I setup my connection...
Dim ab as new ADODB.Connection
Set ab = new ADODB.Connection
Is there something else I should be setting?
-
Re: Updating an ADO Recordset
"Craig" <craig.bielefeld@martinmarietta.com> wrote in message
news:38e1f8fa$1@news.devx.com...
>
> "Marky Mark" <mew@home.com> wrote:
> >
> >"Craig" <craig.bielefeld@martinmarietta.com> wrote:
> >>
> >>I am tying to update an ADO recordset and I keep getting an
error -2147467259,
> >>Insufficient key column information for updating or refreshing.
> >>
> >>Here is my recordset open:
> >>adoActualRS.Open AQuery, ab, adOpenStatic, adLockOptimistic
> >>
> >>and the update statement:
> >>adoActualRS!TotalYearASP = BudASP
> >>adoActualRS![2000PlanTons] = BudTon
> >>adoActualRS.Update
> >>
> >>Any ideas as to why it isn't working??
> >>
> >
> >
> >Craig,
> >
> > It looks to me like the source of your problem lies in the
connectstring
> >property of your connection most likely.
>
> Here is how I setup my connection...
> Dim ab as new ADODB.Connection
> Set ab = new ADODB.Connection
>
> Is there something else I should be setting?
You should certainly remove the 'new' keyword from the declaration thus
Dim ab as ADODB.Connection
Set ab = new ADODB.Connection
Andrew
-
Re: Updating an ADO Recordset
Tell me what the table structure looks like on the table you're trying to
update? What is the primary key? How many columns exist on the table and
are any set not to accept null values?
-
Re: Updating an ADO Recordset
"Craig" <craig.bielefeld@martinmarietta.com> wrote:
>
>I am tying to update an ADO recordset and I keep getting an error -2147467259,
>Insufficient key column information for updating or refreshing.
>
>Here is my recordset open:
>adoActualRS.Open AQuery, ab, adOpenStatic, adLockOptimistic
>
>and the update statement:
>adoActualRS!TotalYearASP = BudASP
>adoActualRS![2000PlanTons] = BudTon
>adoActualRS.Update
>
>Any ideas as to why it isn't working??
>
Craig,
You did not include the actual query string in your example. This may be
something you know or have looked at but if you use the "*" instead of specifying
the actual fields individually, you will get this error. I found out the
hard way.
Hope this helps,
Ralph
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|