0
這是我的代碼,我需要添加很多更行,即時通訊測試只有兩個在SQL語句結束時丟失分號(;)的ASP MYSQL錯誤。試圖處處
' insert into db
mySQL="INSERT INTO scheduleparts (scheduleid, locationid, dayid, partid, stime, guys, position) VALUES (" & pschedid & ", " & pidlocation & ",1,1,'" &ps11& "', " & pg11 & ", " & pp11 & "),(" & pschedid & ", " & pidlocation & ",1,2,'" &ps12& "', " & pg12 & ", " & pp12 & ")"
call updateDatabase(mySQL, rstemp, "addscheduleform4.asp")
我不斷收到錯誤消息「缺少分號(;),在SQL語句的結束」。我添加分號,我得到「預計結束語句」
下面我會發布所有方式我試過分號。我不知道還有什麼要做。
' insert into db
mySQL="INSERT INTO scheduleparts (scheduleid, locationid, dayid, partid, stime, guys, position) VALUES (" & pschedid & ", " & pidlocation & ",1,1,'" &ps11& "', " & pg11 & ", " & pp11 & "),(" & pschedid & ", " & pidlocation & ",1,2,'" &ps12& "', " & pg12 & ", " & pp12 & ");"
call updateDatabase(mySQL, rstemp, "addscheduleform4.asp")
' insert into db
mySQL="INSERT INTO scheduleparts (scheduleid, locationid, dayid, partid, stime, guys, position) VALUES (" & pschedid & ", " & pidlocation & ",1,1,'" &ps11& "', " & pg11 & ", " & pp11 & "),(" & pschedid & ", " & pidlocation & ",1,2,'" &ps12& "', " & pg12 & ", " & pp12 & ")";
call updateDatabase(mySQL, rstemp, "addscheduleform4.asp")
' insert into db
mySQL="INSERT INTO scheduleparts (scheduleid, locationid, dayid, partid, stime, guys, position) VALUES (" & pschedid & ", " & pidlocation & ",1,1,'" &ps11& "', " & pg11 & ", " & pp11 & "),(" & pschedid & ", " & pidlocation & ",1,2,'" &ps12& "', " & pg12 & ", " & pp12 & ";)"
call updateDatabase(mySQL, rstemp, "addscheduleform4.asp")
' insert into db
mySQL="INSERT INTO scheduleparts (scheduleid, locationid, dayid, partid, stime, guys, position) VALUES (" & pschedid & ", " & pidlocation & ",1,1,'" &ps11& "', " & pg11 & ", " & pp11 & "),(" & pschedid & ", " & pidlocation & ",1,2,'" &ps12& "', " & pg12 & ", " & pp12 & ")"
call updateDatabase(mySQL, rstemp, "addscheduleform4.asp");
' insert into db
mySQL="INSERT INTO scheduleparts (scheduleid, locationid, dayid, partid, stime, guys, position) VALUES (" & pschedid & ", " & pidlocation & ",1,1,'" &ps11& "', " & pg11 & ", " & pp11 & "),(" & pschedid & ", " & pidlocation & ",1,2,'" &ps12& "', " & pg12 & ", " & pp12 & ")";"
call updateDatabase(mySQL, rstemp, "addscheduleform4.asp")
' insert into db
mySQL="INSERT INTO scheduleparts (scheduleid, locationid, dayid, partid, stime, guys, position) VALUES (" & pschedid & ", " & pidlocation & ",1,1,'" &ps11& "', " & pg11 & ", " & pp11 & "),(" & pschedid & ", " & pidlocation & ",1,2,'" &ps12& "', " & pg12 & ", " & pp12 & ");";
call updateDatabase(mySQL, rstemp, "addscheduleform4.asp")
而且我沮喪試驗:
' insert into db
mySQL="INSERT INTO scheduleparts (scheduleid, locationid, dayid, partid, stime, guys, position) VALUES (" & pschedid & ", " & pidlocation & ",1,1,'" &ps11& "', " & pg11 & ", " & pp11 & "),(" & pschedid & ", " & pidlocation & ",1,2,'" &ps12& "', " & pg12 & ", " & pp12 & ")";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
call updateDatabase(mySQL, rstemp, "addscheduleform4.asp")
各種方式失敗每次。我要麼丟失分號或預期的語句結尾
檢查是否有幫助:http://stackoverflow.com/a/15440056/1682881 – SearchAndResQ