开发者

ASP : Call ACCESS procedure with accent

开发者 https://www.devze.com 2022-12-21 08:55 出处:网络
I\'m stuck with an application where I have a stored procedure with an accent. Set cmdStoredQuery = Server.CreateObject(\"ADODB.Command\")

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'开发者_Python百科, '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 ?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消