| 发表于:2007-09-05 15:54:044楼 得分:0 |
原码如下: public sub conggoutodb(byval datetime as date) geshi = split(my_meta1.filefieldorder, ", ") geshi1 = split(my_meta1.attributeorder, ": ") geshi2 = split(my_meta1.attributeorder1, ": ") zidonggeshi1 = split(my_meta2.attributeorder, ": ") zidonggeshi2 = split(my_meta2.attributeorder1, ": ") dim mycommandstr as string dim mycommand1 as sqlcommand dim myreader3 as sqldatareader dim count as boolean mycommandstr = "select * from " + trim(my_meta1.tablename) + " where stationid = ' " + trim(my_meta1.stationid) + " ' and observdate= ' " + datetime.toshortdatestring + " 'and observtime= ' " + datetime.tolongtimestring + " ';select * from " + my_meta2.tablename + " where stationid = ' " + my_meta2.stationid + " ' and observdate= ' " + datetime.toshortdatestring + " 'and observtime= ' " + datetime.tolongtimestring + " ' " mycommand1 = new sqlcommand(mycommandstr, myconnection) myreader3 = mycommand1.EXECutereader() 这句是出错的地方!!!! count = myreader3.read() dim i, k, j as integer for i = 0 to geshi2.length - 1 k = ctype(geshi2(i), integer) j = ctype(geshi1(i + 1), integer) if count then melement(k, 0) = myreader3(j) else melement(k, 0) = dbnull.value.tostring end if melement(k, 1) = "0 " next myreader3.nextresult() count = myreader3.read() for i = 0 to zidonggeshi2.length - 1 k = ctype(zidonggeshi2(i), integer) j = ctype(zidonggeshi1(i + 1), integer) if count then melement(k, 0) = myreader3(j) else melement(k, 0) = dbnull.value.tostring end if melement(k, 1) = "0 " next myreader3.close() mycommand1.dispose() end sub 这是类里的一个方法> .. | | |
|