我想向表dodo中添加如下 id shuju shijian max min(这是对应表的字段)
1 第一个 2007-10-10 10 6
2 数码1 2007-10-10 13 3
3 健身房 2007-10-10 90 4
该怎么解决 在线等待。。。。。
或者说用Class
Dim DataTable(3)
Class dodo
Private mid
Private mshuju
Private mshijian
Private mmax
Private mmin
Public Property Let min(vData)
mmin=vData
End Property
Public Property Get min()
min=mmin
End Property
Public Property Let max(vData)
mmax=vData
End Property
Public Property Get max()
max=mmax
End Property
Public Property Let shijian(vData)
mshijian=vData
End Property
Public Property Get shijian()
shijian=mshijian
End Property
Public Property Let shuju(vData)
mshuju=vData
End Property
Public Property Get shuju()
shuju=mshuju
End Property
Public Property Let id(vData)
mid=vData
End Property
Public Property Get id()
id=mid
End Property
End Class
Function BetchAddItem(DataTable)
Dim IdodoA,IdodoB,IdodoC
Set IdodoA=new dodo
IdodoA.id=1
IdodoA.shuju="第一个"
IdodoA.shijian=CDate("2007-10-10")
IdodoA.max=10
IdodoA.min=6
DataTable(0)=IdodoA
Set IdodoB=new dodo
IdodoB.id=1
IdodoB.shuju="数码1"
IdodoB.shijian=CDate("2007-10-10")
IdodoB.max=13
IdodoB.min=6
DataTable(1)=IdodoB
Set IdodoC=new dodo
IdodoC.id=1
IdodoC.shuju="健身房"
IdodoC.shijian=CDate("2007-10-10")
IdodoC.max=90
IdodoC.min=4
DataTable(2)=IdodoC
End Function
Function AddRecordSet(con)
Dim i,rsDo
Set rsDo=Server.CreateObject("ADODB.RecordSet")
rsDo.Open "select * from dodo",con,1,3
For i=0 To UBound(DataTable)
IF Is Not Nothing DataTable(i) Then
rsDo.AddNew
Dim iDodo=DataTable(i)
rsDo("id")=iDodo.id
rsDo("shuju")=iDodo.shuju
rsDo("shijian")=iDodo.shijian
rsDo("max")=iDodo.max
rsDo("min")=iDodo.min
rsDo.Update
End IF
Next
rsDo.Close
Set rsDo=Nothing
End Function
BetchAddItem DataTable
AddRecordSet con'这里的con为数据库连接对象
[此贴子已经被作者于2007-10-10 16:13:39编辑过]