I have one system, WIN98SE with WSH 5.6, that is unable to open recordsets
whether I use the RS.Open method or Conn.Execute.
The code below presents both methods. This the only machine that is having
this problem, I re-installed WSH as a basic trouble-shooting step, but that
wasn't it.
Does anyone have an idea what may be happening here?
Thanks, Patrick
----------------------------------------------------------------------------
-------------
sConn = "DSN=SOTAMAS90;UID=RPT;COMPANY=PLY;PWD=*******"
Set oConn = CreateObject("ADODB.Connection")
oConn.Provider = "MSDASQL"
oConn.Open sConn, adAsyncConnect
Set rsOrder = CreateObject("ADODB.Recordset") 'Comment Out if
Connection.Execute method is used
Set rsItems = CreateObject("ADODB.Recordset") 'Comment Out if
Connection.Execute method is used
sSQLOrd = "SELECT SO1.SalesOrderNumber, SO1.SalesOrderDate, SO1.ShipToName,
SO1.ShipToCity, SO1.ShipToState,"
sSQLOrd = sSQLOrd & " SO1.TaxableAmount + SO1.NonTaxableAmount +
SO1.SalesTaxAmount as SalesTotal"
sSQLOrd = sSQLOrd & " FROM SO1_SOEntryHeader SO1"
sSQLOrd = sSQLOrd & " WHERE SO1.Division = " & chr(39) & sCustDiv & chr(39)
& " AND"
sSQLOrd = sSQLOrd & " SO1.CustomerNumber = " & chr(39) & sCustNo & chr(39)
& " AND"
sSQLOrd = sSQLOrd & " SO1.ShipToCode = " & chr(39) & sShipTo & chr(39) & "
AND"
sSQLOrd = sSQLOrd & cStr(" SO1.SalesOrderDate >= {d " & chr(39) & dBegDT &
chr(39) & "}")
sSQLOrd = sSQLOrd & " ORDER BY SO1.SalesOrderNumber DESC"
'Set rsOrder = oConn.Execute(sSQLOrd)
rsOrder.Open sSQLOrd, oConn
----------------------------------------------------------------------------
-------------