If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > ADO and AS400

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-11-04, 16:48
texasraven texasraven is offline
Registered User
 
Join Date: Feb 2004
Posts: 1
ADO and AS400

Hi Folks,

I want write a windows application that would allow other windows applications to work with AS400 data (read and write). I decided to use ADO w/VB 6.0 instead of ADO.NET due to lack of availability of documentation and failure of several tests.

So far, I have been successful at fetching data from AS400 and updating it using a connected recordset with cursor location set to server (CursorLocation = adUseServer).

However, I would like to use disconnected recordset w/location set to client. Here is the problem: AS400 system doesn't run DB2, but is used as a flat file storage, and I have no metadata about the tables (somehow files are organized as tables). However, applications using this tool will know about the metadata of the tables they work with. In the code below, as soon as I change adUseServer to adUseClient, it fails on Update and throws an error:

Run-time error '-2147467259(80004005)':
Insufficient base table information for updating or refreshing


Code:

Public Function GetData() As adodb.Recordset

Dim adoCnxn As New adodb.Connection
Dim adoCmd As New adodb.Command
Dim adoRecSet As New adodb.Recordset

'adoCnxn.CursorLocation = adUseServer
adoCnxn.ConnectionString = m_strConn
adoCnxn.Open (m_strConn) 'required

With adoCmd
.CommandText = m_strCmd
.CommandType = adCmdText
.ActiveConnection = adoCnxn
.Properties("Updatability") = 1 + 2 + 4
'excluding Properties setting doesn't change anything
'supposedly it is to tell IBM to enable delete, modify, insert
End With

adoRecSet.CursorType = adOpenKeyset
adoRecSet.LockType = adLockOptimistic
adoRecSet.ActiveConnection = adoCnxn
adoRecSet.CursorLocation = adUseClient
------------->'adUseServer works just fine


adoRecSet.Open adoCmd

adoRecSet.Update "MID", "AP" 'update field called MID
-------> fails right here on Update

Set GetData = adoRecSet
End Function




Please help!!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On