|
存在的。
完整的代码
Dim Cmd As New ADODB.Command
Dim param As ADODB.Parameter
''fuser是用户名的变量
ftbname = "Tb_查询_temp_" & fuser
Set Cmd = New ADODB.Command
Set param = Cmd.CreateParameter("@ftablename", adChar, adParamInput, 255, ftbname)
Cmd.Parameters.Append param
''''''删除临时表
rs.Open "SELECT name FROM sysobjects WHERE name = '" & ftbname & "'", cnn, 1, 1
If rs.EOF = False Then cnn.Execute = "DROP TABLE " & ftbname
If rs.State = 1 Then rs.Close
Cmd.CommandType = adCmdStoredProc
Cmd.ActiveConnection = cnn
Cmd.CommandText = "Dt_查询_temp" ''''存储过程
Set rs = Cmd.Execute
CurrentProject.Connection.Execute "insert INTO [" & CurrentProject.Path & "\新建 Microsoft Office Access 应用程序.mdb].[Tb_查询_temp] select * FROM " & ftbname & ""
|
|