Re: Visual Basic - ODBC - Informix OnLine Qs.?
Posted in 1996
Sham Vaidya <smvaidya@aona.remnet.rockwell.com> wrote:
:I currently connect to OnLine Dynamic Server from Visual Basic via
:Intersolv's Datadirect ODBC. Once the connection is made I keep running
:into what seems to be fairly simple problem to solve but have not yet
:come up with the right answer.
:The issue is that sometimes I am able to update a table and sometimes not.
You might have run into the same problem there is with MS Access. May
be ODBC also require indexnames that do not start with a space. They
do if you specify a primary key when you create a table in informix.
You should always do:
create table(...) <-with no primary key here.
create unique index tablename_primary on tablename (fieldnames...);
alter table tablename add constraint primary key (fieldnames...)
constraint tablename_primkey;There are other good reasons than your current problems for allways
doing the above.
We also had problems updating tables while we had the Intersolve
drivers. Most problems dissapered when we changed to OpenLink.
OpenLink is also substantially faster and has much more
functionallity. Check out www.openlinksw.com
:No one besides me accesses the table. The database is an ANSI compliant DB.
Poor sole. Do you *have* to have an ANSI compliant db. There are many
reasons why that is not so good.
:Pseudo code of what I do in Visual Basic is
:---------VB 4.0-----------
:Open Database
:Open Recordset
:Move first
:Set field name
:Update Table
:Commit workspace
:Close Recordset
:Close Database
:--------------------------
:Performance also seems to be a problem. Updates are slow.
1. Appart from changing ODBC driver: Do you use DAO via JET, DAO
direct or RDO. RDO is by far the fastest although DAO ver.3.0 direct
should also be fast. We are currently experimenting with this. I
assume you read the Visual Basic Programmers Journal where they had
several articles about this reasantly. The MS Knowledge Base also have
articles about these issues.
2. Have you tried updates via sql statements that you send directly to
the database. That may be faster and less prone to ODBC problems.
: On exiting my
:application window the OnLine database locks dont get released.
:They are released after I completely exit VB.
This I don't know about. There are however several reasant Knowledge
Base article on the issue of locking on server databases.
To me it looks strange in your code above to do a close recordset (a
cursor) after you have done commit. The commit will close it on the
server. May be VB 4.0 requires the close though, as the cursors may
have been created localy on your PC. Where cursors are created is a
difficult issue we are currently checking out.
:I am running VB 4.0, Intersolv ODBC version 2.12 with I-Net.
:Any advice on data inserts, updates and ODBC interaction would
:be helpful. Feel free to mail an email to me/post to the newgroup, I
:will post a summary at a later date.
Nils.Myklebust@ccmail.telemax.no
NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway
My opinions are those of my company