我有这个在 3rd 方应用程序中运行的 VB 脚本,并抛出“预期语句结束”错误。这是有问题的代码。选择语句在 SQL 服务器管理器工作室中运行良好。
谢谢。
Dim SecurityDB
Set SecurityDB = CreateObject("ADODB.Connection")
Conn = "DRIVER={SQL Server};SERVER=ustcca015s6\Continuum;DATABASE=continuumdb;UID=Andy8796;PWD=xxxx1234;"
SecurityDB.Open Conn
Set EmployeeRS = SecurityDB.Execute "Select count(*) from dbo.personnel where state=1 and lastname not like 'lapt%' and lastname is not NULL and valuelo in (Select ObjectIdLo from area where uiname like 'usmm%' and uiname not like '%gate%') and valuelo <> 1111497912;"
Result = EmployeeRS.GetRows
EmployeeRS.Close
SecurityDB.Close