
accessing sql variables via vbs
This:
is a variable assignment statement. It does not return a resultset. In fact,
none of the statements in you batch returns a resultset. What you need to do
is add a statement that returns a resultset:
This should allow your code to work.
You will get better performance and conde maintainability by encapsulating
this batch into a stored procedure.
HTH,
Bob Barrows
Quote:
> SQL = "SET NOCOUNT ON; INSERT INTO [Order] (<columns
> here>)" & _
> "VALUES (<values here>);" & _
> idShoppingCart = " & idShoppingCart
> set rs = conn.execute(SQL)
> set rs = rs.NextRecordset
> ordernumber = rs(0)
> getting a "type mismatch" on the rs(0) line. any
> thoughts? thank you in advance.