[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 232
  • Last Modified:

insufficient table information for updating or refreshing

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
jbolanos
Asked:
jbolanos
1 Solution
 
Arthur_WoodCommented:
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
 
G2MDCommented:
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
 
TimCotteeCommented:
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
 
jbolanosAuthor Commented:
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

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now