VB5/Informix TEXT columns
Posted in 1998
Topics: Storage & Space Management, Connectivity: ODBC / JDBC / .NET, Jobs, Consulting & Announcements
I'm having problems retrieving columns of type "TEXT" from Informix using RDO or DAO/ODBCDirect. When I try to access a column in a resultset that's of type "TEXT" I get an error: S1C00: [Informix][Odbc Informix Driver]Driver not capable. S1C00: [Informix][Odbc Informix Driver]Driver not capable. -11092 S1109: [Microsoft][ODBC Cursor Library] Invalid cursor position. 0 However, when I try and run the same select from within Access97 as a SQL Pass-Through Query the "TEXT" columns come back no problem. I've tried changing the rdoDefaultCursorDriver to all possible values. The only thing that seems to work is when I set it to rdoUseNone. That's not very useful because then I only get one row back. I'm using NT 4 SP3, VB5 SP2, INFORMIX-OnLine Version 7.23.UC, INFORMIX 2.80 32BIT Version 2.80.004 ODBC Drivers. Here's my code: Dim en As rdoEnvironment Dim cn As rdoConnection Dim qd As New rdoQuery Dim rs As rdoResultset Dim cl As rdoColumn Dim myvariant As Variant Private Sub Form_Load() On Error GoTo form_error With rdoEngine .rdoDefaultLoginTimeout = 20 .rdoDefaultCursorDriver = rdUseIfNeeded End With Set en = rdoEnvironments(0) With en Set cn = .OpenConnection(myDSN_Name, rdDriverPrompt, True, myConnectString); Debug.Print cn.Connect End With Set qd.ActiveConnection = cn 't_table contains a least one column of type "Text" qd.SQL = "select * from t_table" qd.LockType = rdConcurReadOnly Set rs = qd.OpenResultset(rdOpenForwardOnly, rdConcurReadOnly) For Each cl In rs.rdoColumns If cl.ChunkRequired Then 'This is the call that generates the error myvariant = cl.GetChunk(100) End If Debug.Print cl.Name, cl.ColumnSize, cl.Value, CStr(myvariant) Next form_exit: Exit Sub form_error: Dim er As rdoError Debug.Print Err, Error For Each er In rdoErrors Debug.Print er.Description, er.Number Next er Resume form_exit End Sub