本帖最后由 czjt1234 于 2016-4-23 20:06 编辑
| | | Set oWS = CreateObject("WScript.Shell") | | Set oFSO = CreateObject("Scripting.FileSystemObject") | | s = oWS.ExpandEnvironmentStrings("%windir%\SysWOW64\WScript.exe") | | If oFSO.FileExists(s) = True And LCase(WScript.FullName) <> LCase(s) Then | | oWS.Run s & " """ & WScript.ScriptFullName & """" | | WScript.Quit() | | End If | | | | | | If oFSO.FileExists("c:\new.mdb") Then oFSO.DeleteFile "c:\new.mdb" | | Set oCatalog = CreateObject("Adox.Catalog") | | oCatalog.Create "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\new.mdb;Jet OLEDB:Database Password=test;" | | | | | | Set oConnection = CreateObject("Adodb.Connection") | | oConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\new.mdb;Jet OLEDB:Database Password=test;" | | | | | | oConnection.Execute "Create Table 成绩(学号 SmallInt, 成绩 Real)" | | WScript.Sleep 500 | | | | | | | | | | Set oCatalog = CreateObject("Adox.Catalog") | | Set oCatalog.ActiveConnection = oConnection | | oCatalog.Tables.Item("成绩").Name = "8(9)班成绩" | | | | | | oConnection.Execute "Drop Table 8(9)班成绩"COPY |
最后一行报错,SQL里面的()是特殊符号
试了
"Drop Table 8\(9\)班成绩"
"Drop Table 8((9))班成绩"
"Drop Table 8[(]9[)]班成绩"
"Drop Table 8" & Chr(40) & "9" & Chr(41) & "班成绩"
都不行
access数据库SQL语言里面的特殊符号怎么处理? |