|
- StrSQL = ""
- StrSQL = ""
- StrSQL = StrSQL & "INSERT INTO "
- StrSQL = StrSQL & " [odbc;Driver={SQL Server};" '//在空格+[:后面是固定格式
- StrSQL = StrSQL & "Server=" & StrNameServer & ";" '//服务器名称或地址
- StrSQL = StrSQL & "Database=" & StrNameCatalog & ";" '//数据库名称
- StrSQL = StrSQL & "UID=" & StrNameUser & ";PWD=" & StrPassWord & "]" '//用户名,密码]
- StrSQL = StrSQL & ".[" & StrNameTable & "]" '//.[数据表名]
-
- StrSQL = StrSQL & " SELECT [学号],[姓名],[专业],[语文分数],[数学分数] FROM [" & SHX.Name & "$]"
- StrSQL = StrSQL & " AS A WHERE NOT EXISTS ("
-
- StrSQL = StrSQL & " SELECT [学号],[姓名],[专业],[语文分数],[数学分数] FROM "
- StrSQL = StrSQL & " [odbc;Driver={SQL Server};" '//在空格+[:后面是固定格式
- StrSQL = StrSQL & "Server=" & StrNameServer & ";" '//服务器名称或地址
- StrSQL = StrSQL & "Database=" & StrNameCatalog & ";" '//数据库名称
- StrSQL = StrSQL & "UID=" & StrNameUser & ";PWD=" & StrPassWord & "]" '//用户名,密码]
- StrSQL = StrSQL & ".[" & StrNameTable & "]" '//.[数据表名]
-
- StrSQL = StrSQL & " as B WHERE A.[学号]=B.[学号] AND A.[姓名]=B.[姓名] AND A.[专业]=B.[专业]"
- StrSQL = StrSQL & ")"
复制代码 |
|