Results 1 to 2 of 2

Thread: Readfile

  1. #1
    Rahul Guest

    Default Readfile

    I wann to readfile then assign the values to respective variables and the insert those values in database.<BR><BR>Structure of file first file<BR>id, fname, sname, add1,add2<BR>1 ra wa 33 44<BR><BR>second file<BR>fname sname pin<BR>ee rr 111<BR><BR>how can i do this as the column names changes so how can i dynamically assign the values of respective cols to respective variables<BR><BR>can u help me<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Readfile

    Could do something like<BR><BR>Open file with FSO, read first line into tmpVar, split tmp var based on delimiter into tmpArray. Use tmp array to set up first part odf SQL statement ie Insert Into etc ie all field names.<BR><BR>Start loop <BR>read next line of file<BR>split into tmparray<BR>construct resr of sql statement in seperate stringvar, ie values section<BR>execute sql1 & sql2<BR>loop until end of file<BR><BR>Hope this makes sense, I couldn&#039;t be bothered to write out the actual code. Another way might be to use recordset.addnew command then recordset("fieldname (from first arr)") = arr2<BR>recordset.update<BR>

Posting Permissions

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