Dim db As Connection
Dim riqi As String
Dim c As ADODB.Command
Dim nam As String
Dim cnn2 As Connection
Dim rs2 As Recordset
riqi = CStr(Format(Date, "Long Date"))
nam = "工作方式 char(8),Cosφ real,时间 datetime,日期 datetime,Iab real,Iap real,Iaq real,Ibc real,Ibp real,Ibq real,Ica real,Icp real,Icq real,Qab real,Qbc real,Qca real,Uab real,Ubc real,Uca real"
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=" & App.Path & "\hbdata.mdb;"
'On Error Resume Next
Set c = New ADODB.Command
Set c.ActiveConnection = db
c.CommandText = "Create Table " & riqi & " (" & nam & ")"
c.CommandType = adCmdText
db.Errors.Clear
c.Execute
db.Close
Set cnn2 = New Connection
cnn2.CursorLocation = adUseClient
cnn2.Open "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=" & App.Path & "\hbdata.mdb;"
Set rs2 = New Recordset
rs2.Open "select 日期 from biao", cnn2, adOpenStatic, adLockOptimistic
rs2.AddNew
rs2("日期") = CDate(riqi)
rs2.Update
rs2.Close
cnn2.Close
请教从Set c = New ADODB.Command到db.Close结束这段程序每句话什么意思,它又是实现什么功能,用什么方法呢,尤其是关于command到底是怎么一回事~~
先谢谢了!