Results 1 to 2 of 2

Thread: Recordset

  1. #1
    Join Date
    Dec 1969

    Default Recordset

    I have tried to convert my one dimension array into a recordset with the following code, but it wont work. What in tarnation am I doing wrong? Thank you in advance.<BR><BR>Charlie<BR><BR>&#060;%<BR>on error resume next<BR>dim fso,myfile,fname,getline,aList,iLoop,rs<BR>set fso = createobject("Scripting.FileSystemObject")<BR>fnam e = server.mappath("icdb.txt")<BR>response.write ("&#060;p&#062;file..." & fname)<BR>on error resume next<BR>set myfile = fso.opentextfile(fname,1,true)<BR>do while not myfile.atendofstream<BR> getline = myfile.readline()<BR> <BR> aList = split(getline, ";")<BR> <BR> for iLoop = LBound(aList) to UBound(aList)<BR> Response.Write aList(iLoop) & "&#060;br /&#062;"<BR> Next<BR> <BR> loop<BR>myfile.close<BR><BR>Set rs = Server.CreateObject ("ADODB.Recordset")<BR><BR>&#039; and then just loop, using 3 elements of the array at a time: <BR>For recnum = 0 To UBound(aList) STEP 3 <BR> rs("CounryCode") = aList(recnum) <BR> rs("CountryName") = aList(recnum+1) <BR> rs("MRASignatory") = CBool(aList(recnum+2)) <BR> &#039;RS.Update &#039; if you want to save it to the DB <BR>Next <BR>... <BR> <BR>%&#062;<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Recordset

    you&#039;re not doing an .addNew() - so each result overwrites the previous one. you need to addnew() and update()<BR><BR><BR>j<BR>httrp://

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts