problem inserting data to new table

Results 1 to 2 of 2

Thread: problem inserting data to new table

  1. #1
    Join Date
    Dec 1969

    Default problem inserting data to new table

    I am trying to retrieve info from one table and then put it into another table...I can retrieve the info just fine I&#039;m just having trouble putting it into the new is only inserting 1 value into the new table...what am I doing wrong?<BR><BR><BR><BR>deaID=request("deaID")<BR>re gion=request("region")<BR><BR>sql = "SELECT DISTINCT RegionCodes.zipcode FROM RegionCodes WHERE RegionName=&#039;" & region & "&#039;"<BR><BR>&#039;debugging code<BR>Response.Write "DEBUG: SQL is " & sql & "&#060;HR&#062;<BR>"<BR><BR><BR>set getregioncodes = conn.execute(sql)<BR><BR>&#039;Response.Write DebugRs(getregioncodes)<BR><BR><BR> Do while not getregioncodes.eof<BR> <BR> sql2 = "INSERT INTO NewDealercodes (deaID, dealercode) Values (&#039;"&deaID&"&#039;,&#039;"&getregioncodes("zip code")&"&#039;)"<BR><BR> getregioncodes.MoveNext<BR> <BR> loop<BR> <BR> response.write "SQL is " & sql2 & "&#060;HR&#062;<BR>"<BR> set addzipcodes= conn.execute(sql2)

  2. #2
    Join Date
    Dec 1969

    Default ** CROSSPOST **

    Please DO NOT CROSSPOST. It makes things confusing.<BR><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