access的SQL视图一次只能执行一条SQL语句,那么在VBA中调用或许可以简便一些

例如:

Public Sub 批量()
Dim strsql As String  
strsql = "INSERT INTO TEACHER(TNO,TNAME,TSEX,TBIRTHDAY,PROF,DEPART)VALUES (804,'李诚','男','1958-12-02','副教授','计算机系');"
CurrentProject.Connection.Execute strsql
strsql = "INSERT INTO TEACHER(TNO,TNAME,TSEX,TBIRTHDAY,PROF,DEPART)VALUES (856,'张旭','男','1969-03-12','讲师','电子工程系');"
CurrentProject.Connection.Execute strsql
strsql = "INSERT INTO TEACHER(TNO,TNAME,TSEX,TBIRTHDAY,PROF,DEPART)VALUES (825,'王萍','女','1972-05-05','助教','计算机系');"
CurrentProject.Connection.Execute strsql
strsql = "INSERT INTO TEACHER(TNO,TNAME,TSEX,TBIRTHDAY,PROF,DEPART)VALUES (831,'刘冰','女','1977-08-14','助教','电子工程系');"
CurrentProject.Connection.Execute strsql
End Sub

04-28 18:36