SQLServer 7 ODBC PreparedStatements do now work

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

SQLServer 7 ODBC PreparedStatements do now work

Jochen Riekhof
I tried out the following statements with the standard MS-Northwind sample
DB and found no way to get it to work:

dbConn := DBConnection new dsn: 'NorthWind'; uid: 'sa'; connect.
stmt := dbConn prepare: 'SELECT * FROM Orders where OrderID = ?'.
stmt paramCols: (dbConn query: 'SELECT OrderID FROM Orders') describeCols.
stmt values: #(10405).
stmt exec.

It always fails with
"37000: [Microsoft][ODBC SQLServer Driver][SQLServer] Line 1: Wrong syntax
near "OUTPUT"

(translated from german).

This one works:
dbConn := DBConnection new dsn: 'NorthWind'; uid: 'sa'; connect.
stmt := dbConn prepare: 'SELECT * FROM Orders where OrderID = 10405'.
stmt exec.

but does not help much ;-).

Any idea?

Ciao

...Jochen