Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
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 |
Display Modes | |
|
|