文件名称:asp循环插入多条数据
文件大小:6KB
文件格式:TXT
更新时间:2017-08-17 11:28:29
asp,vb
asp循环插入多条数据的典型案例 '循环添加到数据库 For i=0 To UBound(pg_fltNo) objStrSTime = pg_sTime(i)&" "&pg_sHour(i)&":"&pg_sMin(i)&":"&pg_sSend(i) objStrETime = pg_eTime(i)&" "&pg_eHour(i)&":"&pg_eMin(i)&":"&pg_eSecd(i) strSql= " insert into ba_flightMileage "&_ " ( flightId, dayNum, flightNo, airlineCn, airlineEn, airfares, planeTypes, "&_ " startPoint, departureAirport, departureCode, departureTerminal, startTime, "&_ " [endPoint], arriveAirport, arriveCode, arriveTerminal, endTime, isNight ) "&_ " values "&_ " ("& objItem.item("fltId") &", '"& pg_dayNum(i) &"', '"& pg_fltNo(i) &"', '"& pg_airlineCn(i) &"', '"& pg_airlineEn(i) &"', '"& pg_airfares(i) &"', '"& pg_planeTypes(i) &"',"&_ " '"& pg_sPoint(i) &"', '"& pg_departAirport(i) &"', '"& pg_departCode(i) &"', '"& pg_departTerminal(i) &"', '"& objStrSTime &"', "&_ " '"& pg_ePoint(i) &"', '"& pg_arriveAirport(i) &"', '"& pg_arriveCode(i) &"', '"& pg_arriveTerminal(i) &"', '"& objStrETime &"', '"& pg_isNight(i) &"')" conn.execute(strSql) Next