Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted
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

the 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

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.

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...