dim RsTest as ADODB.Recordset
....'---记录集初始化
RsTest.Fields(0).Attributes = RsTest.Fields(0).Attributes Or AdoEnums.FieldAttribute.ISNULLABLE
RsTest.Fields(0).OriginalValue = "Example"
....'---记录集初始化
RsTest.Fields(0).Attributes = RsTest.Fields(0).Attributes Or AdoEnums.FieldAttribute.ISNULLABLE
RsTest.Fields(0).OriginalValue = "Example"
Private Sub CreateTable(cn As ADODB.Connection) Dim sSQL As String
On Error Resume Next
MousePointer = vbHourglass
'Make certain that the table is created by dropping the table
' If the table doesn't exist the code will move on to the next statement
sSQL = "Drop Table department"
cn.Execute sSQL
'Reset the error handler and create the table
' If an error is encountered it will be displayed
On Error GoTo ErrorHandler
sSQL = "Create Table department " _
& "(Dep_ID Int Not Null, Dep_Name Char(25), Primary Key(Dep_ID))"
cn.Execute sSQL
MousePointer = vbDefault
Exit Sub
ErrorHandler:
DisplayADOError cn
MousePointer = vbDefault
End Sub