Vbscript 为什么会抛出不正确的systax错误?

Vbscript 为什么会抛出不正确的systax错误?,vbscript,Vbscript,我正在使用的vb脚本在“,”附近的第43行抛出一条错误语法的消息。但我不明白为什么它会抛出这个信息。以下是抛出错误的代码: Function getRS (sql) ' this loads the results of the sql statement into adoRecordset 'response.write sql Set adoConnection = Server.CreateObject("ADODB.Connection")

我正在使用的vb脚本在“,”附近的第43行抛出一条错误语法的消息。但我不明白为什么它会抛出这个信息。以下是抛出错误的代码:

Function getRS (sql)
      ' this loads the results of the sql statement into adoRecordset

      'response.write sql

      Set adoConnection = Server.CreateObject("ADODB.Connection")
      Set adoRecordset= Server.CreateObject("ADODB.Recordset")
      adoRecordset.CursorType = adOpenStatic
      adoConnection.Open connectString
      adoRecordset.Open sql, adoConnection

   End Function

这里的这一行是第43行:
adoRecordset.opensql,adoConnection
但是为什么逗号会导致这里的语法不正确?

你确定你有连接吗?连接字符串从哪里来?这个代码对我来说很有用,我很确定它确实有用。当我运行该程序时,它会将相同的函数用于许多其他事情。就在我单击某个页面上的ok时,它抛出了这个问题。可能是“sql”值的问题,因为它只发生在其中一个页面上。当它失败时,你能公布它的价值吗