Solved

insufficient  table information for updating or refreshing

Posted on 2002-05-16
4
214 Views
Last Modified: 2010-05-02
I've  been looking information for this issue
and i found an upgrade of mdac_typ.exe to 2.5
I did that but didn't not work, then i upgrade to mdac 2.6 and again it did'nt work

i have code like this:

...
dim APP_CNN as ADODB.connection
dim adoProg as ADODB.Recordset
dim SQLstr as string

Set APP_CNN = NEW ADODB.connection
APP_CNN.Open "Provider= MSDASQL.1; Data Source= cga"

Set adoProg = NEW ADODB.Recordset
sqlstr = select * from sales"
adoprog.open sqlstr,app_cnn,adOpenStatic,adLockOptimistic
.
.
.
adoprog![field1] = 17
adoprog.update        -- Error Line

....

Error ocurrs sometimes in update, sometimes in addnew
sometimes same lines work fine
I'm using Visual Basic 6.0 with an INFORMIX database
accesed trough odbc (informix odbc 3.30)
0
Comment
Question by:jbolanos
4 Comments
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 7015414
what error are you getting.  In the code snippet that you showk, I do not see EITHER an adoprog.addnew OR adoprog.Edit.  YOu MUST have one or the other, BEFORE you an use .update.

And if you try to .Addnew a new record that ALREADY exists, you may generate an error, due to the duplicate record entry.

If you are going to update a record, then your SQL shoyuld select the record to be updated, but your SQL selects ALL of the records from the sales table.

On the other hand, if you are going to add a NEW record to the table, then the SQL should only serve to build the field list of the recordset, and should not actually retrieve ANY real records from the table (Select * from sales where salesID = 0 (assumiong that salesID is the Primary key of the table, and that there is NO real record wioth SalesID = 0.
0
 

Accepted Solution

by:
G2MD earned 100 total points
ID: 7015518
I recomend you use sql statement(dbcon.execute varStmt) for actions like insert, update or delete furthermore is faster and go directly to the database server.
Don't use that ****
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 7015718
G2MD: You are not new to this site and should be aware of the guidelines on comments vs answers. Please re-read these at the bottom of this page and do not post answers in this way in future. If you continue to do so your account will be referred to customer services for possible penalty. Please also update your open questions, you have 12 open questions currently, failure to maintain your own questions is also grounds for account suspension or termination.

jbolanos: you should reject this proposed answer at this time, remember that if you feel it is the best answer you can always choose "accept comment as answer" at any time. A question that has an answer proposed is in the locked section and is likely to get less traffic than one awaiting an answer, in order to allow all experts an equal opportunity to view and comment it is much better to leave it in the questions awaiting answers section of the topic area.

To address your specific problem, it is most likely to do with the table and whether or not it has a primary key.
0
 

Author Comment

by:jbolanos
ID: 7016551
Arthur:
Sorry, the code not is a copy&paste of my program, is only a example.  I make almost all my forms with the form wizard with ODBC connection and ADO code and my source code is ok. but sometimes add,edit or delete works and sometimes not.

G2MD:

in some procedures i use APP_CNN.execute and it works fine and fast, but i have a lot of forms created with the form wizard

Tim: Ok.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

939 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now