Solved

insufficient  table information for updating or refreshing

Posted on 2002-05-16
4
212 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

747 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

11 Experts available now in Live!

Get 1:1 Help Now