Using VB code to access Informix database

Using VB code to access Informix database

Post by vive » Thu, 27 Sep 2001 01:27:49



I am using Visual Basic 6.0 to access a Informix database ver 7.31 . I have
used ADO to connect to the database and to scroll through and alter the
database.
MoveFirst , MoveNext  methods work fine.
Modify and delete also work ok.

When i try to use MovePrevious  method
of the ADO Library 2.5 i get the following error
"Rowset does not support fetching backward"
Also for the MoveLast method a error is shown.

When AddNew and Update method is used to add
a new record to the database a error is shown

[Informix] [Informix ODBC Driver]  [Informix]  [Unspecified System Error
= -201]
Run-time error "3219" Operation is not allowed in this context.

Please let me know the solution for this.

Cheers,
Vivek

 
 
 

Using VB code to access Informix database

Post by Austin Castr » Thu, 27 Sep 2001 12:04:12


The moveprevious problem is due to the cursor type you've chosen.  You need
to use the adOpenDynamic property.  something like this

RS.Open Cn, SqlStr, adOpenDynamic.

By default, ADO opens recordsets as forward only

-----Original Message-----


Sent: Tuesday, September 25, 2001 8:28 AM

Subject: Using VB code to access Informix database

I am using Visual Basic 6.0 to access a Informix database ver 7.31 . I have
used ADO to connect to the database and to scroll through and alter the
database.
MoveFirst , MoveNext  methods work fine.
Modify and delete also work ok.

When i try to use MovePrevious  method
of the ADO Library 2.5 i get the following error
"Rowset does not support fetching backward"
Also for the MoveLast method a error is shown.

When AddNew and Update method is used to add
a new record to the database a error is shown

[Informix] [Informix ODBC Driver]  [Informix]  [Unspecified System Error
= -201]
Run-time error "3219" Operation is not allowed in this context.

Please let me know the solution for this.

Cheers,
Vivek


 
 
 

1. Exporting data to excel report from access database using vb code

Hi
I have a vb application which was written for windows 95,
platform. It uses Jet 3.51 OLE DB provider. The database
to which this application connects to is an Access 97
database (or in some cases access 2000) database. The
access database has some queries written. The VB code
passes begin and end date parameters and which query to
run, to the access database. An excel file is created, and
the result of the query is then dumped in this new excel
file. Every time I run this piece of the application, I
can see the correct parameters being passed to the
database from the vb code. Moreover, I see the correct
values coming back from the query result into the variable
which would dump the value in the excel file. Every time
the excel file is created. However, once the execution of
the code is completed, some times there is data in the
file and sometimes there is no data in the file. I am
lost, as I always see the result of the query being
returned to the vb code; however, the end file itself
sometimes has the data and sometimes does not.
I have remmed out the following lines from the code,
everywhere I found them, but still there is no difference
in the result:
    Set objExcelWS = Nothing
    Set objExcelWB = Nothing

objExcelWS and objExcelWB have been defined earlier in the
code as follows:
    Dim objExcelWB As Excel.Workbook
    Dim objExcelWS As Excel.Worksheet
Would anyone have any ideas?
Thanks

2. Which is faster ?

3. Accessing Remote Oracle database using VB code.

4. Heterogeneous Database Replication over Internet

5. Tool/code to clear owners on a Btrieve database using VB, Access or Java

6. 'machine vision'-related mailing

7. linking one access database to another access database through vb.net code

8. odbctest error message

9. Importing an Access 2000 table into another Access 2000 database with VB Code

10. Newbie needs code pages for SQL Server 2000 access from asp.net page using vb.net

11. Putting a picture in Access using vb code

12. Possibility of creating MS-ACCESS DB using VB code

13. How to Update Access queries using VB code