2 Replies Latest reply on Apr 1, 2013 10:10 AM by 998158

    FDM script issue

    998158
      Hi,

      I'm trying FDM custom script to copy records from text file to oracle database.

      I've created 'sample' table in database.

      when I try to open table in script I get 'Arguments are of wrong type or out of acceptable range"

      Below is the statement where I am receiving error:

      *+Set rs = cnSS.OpenRecordSet("sample")+*

      Below is the logic:


      *+Set cnSS = CreateObject("ADODB.Connection")+*
      *+Set rs = CreateObject("ADODB.Recordset")+*
      *+strFile = "D:\Toload.txt"+*

      *+cnss.open "Provider=xxxxx;Data Source=xxxxx;User ID=xxxx;Password=xxxx"+*

      *+Set rs = cnSS.OpenRecordSet("sample")+*

      *+Set fso = CreateObject("Scripting.FileSystemObject")+*
      *+If fso.FileExists(strFile) Then+*
      *+Set Objfso = fso.OpenTextFile(strFile, 1, False)+*

      *+Do While Objfso.AtEndofStream <> True+*
      *+rs.Addnew+*
      *+For i = 0 To Objfso.Fields.Count - 1+*
      *+On Error Resume Next+*
      *+rs.Fields(i) = Objfso.Fields (i)+*
      *+Next+*
      *+rs.Update+*
      *+Objfso.MoveNext+*

      *+Loop+*
      *+Objfso.Close+*

      *+Set fso=Nothing+*
      *+End If+*


      Please let me know if I'm missing something.

      Thanks in advance

      Edited by: 995155 on Mar 29, 2013 10:43 AM

      Edited by: 995155 on Mar 29, 2013 10:44 AM