Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Esperanza
 
Posts: n/a
Default Excel and IBM bd2 database

Hy Excel Experts !

I need to export data from excel to AS400 DB2 file database.
I have full right on the library file.

I always got the following error message:

"3251 Current Recordset does not support updating. This may be a limitation
of the provider, or the selected locktype"


Thanks for your help!!
Experanza




'================================================= ===
Voici le code :
Dim rsTables As Recordset
Dim strSelect, strPassWord400
Set conn = New ADODB.Connection
Dim nbrRecords, NoLigne, index As Integer


strPassWord400 = InputBox("Veullez entrez votre mot de passe 400")

conn.Open "Provider=IBMDA400;Password=" & strPassWord400 & ";User
ID=COCO;Data Source=tttt.cccc.qc.ca;Transport Product=Client
Access;SSL=DEFAULT"


Set rsTables = New ADODB.Recordset

On Error GoTo Exportation_ERR

rsTables.Open "COCO.FILE", conn, adOpenKeyset, adLockOptimistic,
adCmdTable

'================================================= =================
'TEST D'ECRITURE DANS LE FICHIER 400
'================================================= ================


For NoLigne = 2 To 10

rsTables.AddNew
rsTables!EMPNUM = ActiveSheet.Range("A" + CStr(NoLigne))
rsTables!LUN = ActiveSheet.Range("B" + CStr(NoLigne))
rsTables!MAR = ActiveSheet.Range("C" + CStr(NoLigne))
rsTables!MER = ActiveSheet.Range("D" + CStr(NoLigne))
rsTables.Update
Next

Exit Sub

Exportation_ERR:
MsgBox (Err.Number & " " & Err.Description)

End Sub




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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



All times are GMT +1. The time now is 12:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"