teixeira Posted February 18, 2006 Posted February 18, 2006 Hi all, I have a query to execute against an access database and is strange, because inside Access querys directly it executes perfectly, but inside my code its not executes, giving an error about the REPLACE keyword.The sql statement is the following: SELECT CODIGO,CODBARRA FROM ARTIGOS WHERE REPLACE(CODIGO,'.','')<>CODBARRA Note: I'm using Microsoft.Jet.OLEDB.4.0 as my Data Provider. with C# 2005 If anyone can help me about this, i'll be very thankfull Rgds Tiago Teixeira Quote
Joe Mamma Posted February 19, 2006 Posted February 19, 2006 Hi all, I have a query to execute against an access database and is strange, because inside Access querys directly it executes perfectly, but inside my code its not executes, giving an error about the REPLACE keyword.The sql statement is the following: SELECT CODIGO,CODBARRA FROM ARTIGOS WHERE REPLACE(CODIGO,'.','')<>CODBARRA Note: I'm using Microsoft.Jet.OLEDB.4.0 as my Data Provider. with C# 2005 If anyone can help me about this, i'll be very thankfull Rgds Tiago Teixeirathe replace function is deactivated by security configuration for applications outside of access. this can be overroiden via a registry setting, but this might not be suitable. for apps that call to the jet REPLACE I use a combination of instr and mid. its a pain I know, but its the only way to do it without changing the registry. for a list of the 'safe' jet functions look here and an outline of the configuration: http://support.microsoft.com/default.aspx/kb/294698 Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
teixeira Posted February 19, 2006 Author Posted February 19, 2006 Hi, Thanks for your help, I used your suggestion and it is ok, but as you said it is more hard to code ( just a little) ;-). And thanks for the link of the article, it give good informations. Rgds Tiago Teixeira Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.