views:

30

answers:

1

Hello,

I'm stuck with an application where I have a stored procedure with an accent.

Set cmdStoredQuery = Server.CreateObject("ADODB.Command")
cmdStoredQuery.ActiveConnection = Conn
cmdStoredQuery.CommandText = "S_Réseau"

Set RS = server.createobject("ADODB.Recordset")
Set RS = cmdStoredQuery.Execute

When I execute it, it says :

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'.

I have tried to change the encoding of the page to UTF-8 : not working. So I'm sure there is something to be done at the server level to make it work, since it works well in production with the exact same code. In production it works fine, but locally I can't configure it.

So is there a server setting to set on IIS to make this work ?

Thanks

A: 

Enclose the stored procedure name in square brackets:

cmdStoredQuery.CommandText = "[S_Réseau]" 

Does it work?

Edit. It doesn't work. Another suggestion: create a query in the database that invokes S_Réseau but doesn't use accented letters in its name. Then call that query from your code.

CesarGon
No... And like I said, there should'nt be any change at code level to be done since it's already in production.
Amadeus45
Well, you may have to code more defensively, or avoid accented chars on identifiers. Even though your code works in *some* machines, that does not guarantee it will work in all. Aspects such as the OS, IIS or ODBC drivers' locales may affect the outcomes.
CesarGon
It's not my code and of course I wouldn't have done so if it was mine. I have to fix this pae and can't test it locally and I don't have time nor rights to remove all accute accent from the database.
Amadeus45
I understand. Can't you create a query in the database that calls S_Réseau and invoke that query from your code?
CesarGon