Seraching for given string using access

Hi, this is provbably a simle problem but I carnt see what the problem is so I would appreciate if some1 could see it
Im trying to retrieve a record in a database by passing the following sql line:
strSQL = "SELECT * FROM STAFF WHERE STAFF.NAME EQUALS "+str_Name;
it then brings up the folowing error
SQLState : 37000
Message : [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'STAFF.NAME EQUALS william tell'.
Vendor code : -3100
i've tried other variations like
strSQL = "SELECT * FROM STAFF WHERE STAFF.NAME EQUALS \""+str_Name+"\""; and rearranging the lines but to no avail its probably really simple but i carnt see what is wrong, would appreciate any ideas

thanks for the reply it worked for some strange reason with single quotes:
strSQL = "SELECT * FROM STAFF WHERE STAFF.NAME LIKE \' "+str_Name+"\' ";

Similar Messages

  • Match pattern for multiple strings in labVIEW

    I want to include multiple strings for matching in the regular expression for pattern matching.I tried using the or option and (|)
    eg:cat|dog|mouse
    If the string contains any of these it should show a match.
    Is it possible in labview or do i need to use multiple patch mattern functions to achieve this?

    Match Regular Expression function will do.
    You can search for multiple strings using | operator. This function will return the match of any one of the specified strings seperated by | operator

  • I forget my access code to open it, what can i do to open it again and use my ipod as before,thanks for given me one solution.

    what can i do to off the access code i put and forget, for me to use my ipod touch like before ? thanks to try to give me a solution for me to use it again as beofre.

    connect to iTunes
    Sync it
    Restore it
    Set it up from the backup

  • Using the - key to stand for a string of characters

    If I am seraching for all the words that start with V,v and end with C,c. What is the best way to do this?
    I want to make - stand for [a-z and A-Z]
    so that the user could just enter something at the command-line such as V-C.
    But, I know if I do this then the user could also use that - variable at the end of their argument such as VC- which I do not want. I only want to run the program if - is in the middle of text
    v-c = good
    vc- = bad
    -vc =bad
    I'm just thinking out loud but if I were to run an if loop that only used the argument at the command line if it fulfilled the following conditions
    if (argv[0] =[V,v][-][C,c]
    //run program
    else
    (exit program)
    Am I thinking along the right way? (probably not... )
    Thanks for any advice.

    import java.io.*;
    public class StartsWith {
    public static void main(String[] args) {
    String search = args[0];
    for (int i=0; i < search.length (); i++) {
    if (search.startsWith ("[AEIOUaeiou]*") !=false){
    System.out.print("CORRECT");
    if (search.startsWith ("[AEIOUaeiou]*") !=true){
    System.out.print("ERROR");
    }Whenever I add a word even if it starts with a vowel
    I always get error...
    Can anyone see why?
    Thanks for the advice.I think I can understand how startswith works. It just excepts a "text" as opposed to other otpions...
    Regex it is...

  • No value for given parameters error when using command parameters in RDC.

    I am trying to create a report using RDC with a parameter in the query, but I keep getting "No value for given parameters" error.  Here is the code I use:
    Dim creport As CRAXDDRT.Report
    Dim appn As CRAXDDRT.Application
    Dim datcmd1 As New ADODB.Command
    Dim adocn As New ADODB.Connection   
    Dim sqltext As String
    Dim x As CRAXDDRT.ParameterFieldDefinition
    Set appn = New CRAXDDRT.Application
    Set creport = appn.NewReport
    Set x = creport.ParameterFields.Add("test", 2)
    x.AddCurrentValue 0
    sqltext = "SELECT Name FROM TestTable WHERE ID={?test}"
    Set adocn = New ADODB.Connection
    adocn.Open "Provider=SQLOLEDB;Data Source=myDB;UID=xxx;PWD=xxx;"
    Set datcmd1 = New ADODB.Command
    Set datcmd1.ActiveConnection = adocn
    datcmd1.CommandText = sqltext
    creport.Database.AddADOCommand adocn, datcmd1
    creport.SaveAs "test", crDefaultFileFormat
    Set datcmd1 = Nothing
    Set adocn = Nothing
    Set creport = Nothing
    Set appn = Nothing

    Hello, Paul;
    If you add your database connection to the command object and put fields on your report without the parameter, do you get the report you expect?
    These are version 8/8.5 samples but the code is the same:
    [Note 1|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do]
    [Note 2|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do]
    Once you have added the database connection follow that with the parameter code.
    [Note 3|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do]
    [Note 4|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do]
    If you add the parameter and put the field on the report, can you pass the value successfully?
    Elaine

  • SQL Query to search all the tables for a given string

    Hi all,
    This is concerning a query to search each and every table/column for a given string.
    I came across a similar post (Re: question about searching 600 tables and this query seems to be inline with my requirements:
    select table_name,
    column_name,
    :search_string search_string,
    result
    from cols,
    xmltable(('ora:view("'||table_name||'")/ROW/'||column_name||'[ora:contains(text(),"%'|| :search_string || '%") > 0]')
    columns result varchar2(10) path '.'
    where table_name in ('MY_TABLE')
    However, I am getting the following error:
    ORA-24451: OCIKCallPushTrusted, Maximum call depth exceeded
    I am using Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit and could you please let me know the best possible way to accomplish this task?
    Thanks.
    Edited by: itech.quest on Sep 19, 2010 8:30 AM

    Hi Tamir,
    Thanks so far. I am yet to make the crucial breakthrough as far my application goes. Are you talking about the EUL5_QPP_STATS table? I tried retrieving worksheets even from that table also with the following query
    SELECT DISTINCT Eul5QppStats.QS_DOC_NAME,Eul5QppStats.QS_DOC_DETAILS
    FROM EUL5_QPP_STATS Eul5QppStats,EUL5_DOCUMENTS Eul5Documents
    WHERE Eul5QppStats.QS_DOC_NAME = Eul5Documents.DOC_NAME
    However, the worksheet data retrieved by Discoverer Oracle's product is not matching my dataset for every workbook. Please suggest.
    Reg
    Thomas

  • Search given string array and replace with another string array using Regex

    Hi All,
    I want to search the given string array and replace with another string array using regex in java
    for example,
    String news = "If you wish to search for any of these characters, they must be preceded by the character to be interpreted"
    String fromValue[] = {"you", "search", "for", "any"}
    String toValue[] = {"me", "dont search", "never", "trip"}
    so the string "you" needs to be converted to "me" i.e you --> me. Similarly
    you --> me
    search --> don't search
    for --> never
    any --> trip
    I want a SINGLE Regular Expression with search and replaces and returns a SINGLE String after replacing all.
    I don't like to iterate one by one and applying regex for each from and to value. Instead i want to iterate the array and form a SINGLE Regulare expression and use to replace the contents of the Entire String.
    One Single regular expression which matches the pattern and solve the issue.
    the output should be as:
    If me wish to don't search never trip etc...,
    Please help me to resolve this.
    Thanks In Advance,
    Kathir

    As stated, no, it can't be done. But that doesn't mean you have to make a separate pass over the input for each word you want to replace. You can employ a regex that matches any word, then use the lower-level Matcher methods to replace the word or not depending on what was matched. Here's an example: import java.util.*;
    import java.util.regex.*;
    public class Test
      static final List<String> oldWords =
          Arrays.asList("you", "search", "for", "any");
      static final List<String> newWords =
          Arrays.asList("me", "dont search", "never", "trip");
      public static void main(String[] args) throws Exception
        String str = "If you wish to search for any of these characters, "
            + "they must be preceded by the character to be interpreted";
        System.out.println(doReplace(str));
      public static String doReplace(String str)
        Pattern p = Pattern.compile("\\b\\w+\\b");
        Matcher m = p.matcher(str);
        StringBuffer sb = new StringBuffer();
        while (m.find())
          int pos = oldWords.indexOf(m.group());
          if (pos > -1)
            m.appendReplacement(sb, "");
            sb.append(newWords.get(pos));
        m.appendTail(sb);
        return sb.toString();
    } This is just a demonstration of the technique; a real-world solution would require a more complicated regex, and I would probably use a Map instead of the two Lists (or arrays).

  • Multi-language support for user-specified text strings used in the forms

    multi-language support for user-specified text strings used in the forms
    Instead of creating multiple forms, 1 in each different language, for the same service, is there any workaround?

    Hoan - is your question what are the considerations when creating multiligual catalogs? If so, I can tell you that at other clients I have seen them use a single catalog for one or two languages. For the two langugages, such as Spanish/English, you can create a single catalog with both of them. Once you get to more than two languages, the catalog would get unweildy and is therefore not suggested.

  • I used a partitioned HDD for time machine, using a partition already containing other data files. I am now no longer able to view that partition in Finder. Disk Utility shows it in grey and "not mounted". Any suggestions of how to access the files?

    I used a partitioned HDD for time machine, using a partition already containing other data files. I am now no longer able to view that partition in Finder. Disk Utility shows it in grey and "not mounted". Any suggestions of how to access the files? Does using time machine mean that that partition is no longer able to be used as it used to be?
    HDD is a Toshiba 1TB, partitioned into two 500GB partitions.
    OS X version 10.9.2

    Yes, sharing a TM disk is a bad idea, and disks are cheap enough so that you don't need to.
    Now
    Have you tried to repair the disk yet

  • How can I access the savestore.js contents if the command about:sessionrestore shows a blank box even for already succesfully used backups?

    -------------------------------------------------------------------------------------------------------------------------------------------
    How can I access the savestore.js contents if the command about:sessionrestore shows a blank box even for already succesfully used backups?
    Is there a recent known problem with the about:sessionrestore command or is there any other way understandable to Firefox 29.0.1 through which recover the information stored in the sessionstore.js files.
    It seems the command about:sessionrestore is not capable anymore to read the contents of the sessionstore.js file present in the user profile folder.
    The box where windows and tabs should be listed is empty.
    I tried to paste a few old sessionstore.js files in the user directory while the firefox.exe process was not active, then opened Firefox again and tried to launch the about:sessionrestore command without any result.
    I think the files are not corrupted because I used most of them in other occasions and I stored them in folders not connected to the common use of any process.
    Also, I already successfully used the about:sessionrestore command in Firefox 29.0.1 in a few other occasions.
    I did a "clean reinstall" of Firefox 29.0.1 and the box contained in the tab where about:sessionrestore is executed is still empty even if the files themselves contain such information as tabs location and html addresses.
    After this I recovered the profile data I had stored in another folder and this is what you can see attached to this question.
    ---------------------------------------------------------------------------------------------------------

    If I select the "show my windows and tabs from last time" option in the startup settings the contents of any savestore.js file i paste in the user profile folder are opened without any problem.
    still, the box in the tab loaded by the about:sessionrestore command is blank and empty, so it's not possible to "de-select" any window or tab. it's necessary to find an editor to modify session backup files which may contain "bad addresses".
    does such an editor already exists?

  • How do i search for a string in a txt file using java??

    How do i search for a string in a txt file using java??
    could you please help thanks
    J

    Regular expressinos work just fine, especially when
    searching for patterns. But they seem to be impying
    it's a specific group of characters they're looking
    for, and indexOf() is much faster than a regex.If he's reading from a file, the I/O time will likely swamp any performance hit that regex introduces. I think contains() (or indexOf() if he's not on 5.0 yet) is preferable to regex just because it's simpler. (And in the case of contains(), the name makes for a very clear, direct mapping between your intent and the code that realizes it.)

  • Problems using access control in sender agreement for SOAP adapter 7.1

    I am trying to use Access Control Lists to restrict user access to web services/interfaces which are exposed via PI. This can be configured via the Integration Builder Directory using the u201CAssigned Usersu201D tab of both Communication Components (Business System) and Sender Agreements.
    The configuration is via the above mentioned components. However, I understand that itu2019s the adapters which at runtime are responsible for actually applying these checks.
    I have been having problems getting the access control to work using a setup involving a SOAP adapter of type SAP BASIS 7.10.
    The symptom of the problem is that although the access control works as expected at the Business System level, any settings at the Sender Agreement level appear to have absolutely no effect whatsoever.
    I have confirmed that I have no problems if I use an adapter of type SAP BASIS 7.00. However, I really need to get this working on 7.1.
    I have looked on the SAP support portal but can not find any notes that relate to this.
    Has anyone else had a similar problem? And have you found a fix for it?
    Any suggestions would be welcome.
    Edited by: Malcolm Dingle on Jun 17, 2009 1:08 PM

    Hi Shai,
    Please have a look at the following link and see if it helps you .
    It deals with SOAP adapter installation and activation 
    Re: SOAP adapter installation and activation
    Best Regards
    Edited by: Prakash Bhatia on May 8, 2009 11:51 AM

  • How to search for upper/lower case using string using JAVA!!!?

    -I am trying to write a program that will examine each letter in the string and count how many time the upper-case letter 'E' appears, and how many times the lower-case letter 'e' appears.
    -I also have to use a JOptionPane.showMessageDialog() to tell the user how many upper and lower case e's were in the string.
    -This will be repeated until the user types the word "Stop". 
    please help if you can
    what i have so far:
    [code]
    public class Project0 {
    public static void main(String[] args) {
      String[] uppercase = {'E'};
      String[] lowercase = {'e'};
      String isOrIsNot, inputWord;
      while (true) {
       // This line asks the user for input by popping out a single window
       // with text input
       inputWord = JOptionPane.showInputDialog(null, "Please enter a sentence");
       if ( inputWord.equals("stop") )
        System.exit(0);
       // if the inputWord is contained within uppercase or
       // lowercase return true
       if (wordIsThere(inputWord, lowercase))
        isOrIsNot = "Number of lower case e's: ";
       if (wordIsThere(inputword, uppercase))
         isOrIsNot = "number of upper case e's: ";
       // Output to a JOptionPane window whether the word is on the list or not
       JOptionPane.showMessageDialog(null, "The word " + inputWord + " " + isOrIsNot + " on the list.");
    } //main
    public static boolean wordIsThere(String findMe, String[] theList) {
      for (int i=0; i<theList.length; ++i) {
       if (findMe.equals(theList[i])) return true;
      return false;
    } // wordIsThere
    } // class Lab4Program1
    [/code]

    So what is your question? Do you get any errors? If so, post them. What doesn't work?
    And crossposted: how to search for upper/lower case using string using JAVA!!!?

  • How to search for perticular substring in given string.

    Hi, Can any one tell me how to search for perticular substring in given string.
    example:
    I have to search for CA in given Order type it may be CA10 or CA15. Please Do the needful.

    Hi Aniruddha,
    check this...
    Data var string,
    var = 'India'.
    search var for 'Ind'.
    if sy-subrc = 0.    " var having ind
    Message 'Ind found' type 'I'.
    else  .            "var not having ind
    Message 'Ind not Found' type 'I'.
    endif.
    thanx
    bgan.

  • Is there a time limit for how long a free form can be used/accessed?

    Is there a time limit for how long a free form that is created can be used/accessed, or is it soely dependent upon when the 50 respondent max has been reached?  I am creating a form now, that will likely be distributed in early January, and I want it to be accessible through the end of June, 2013.  (I am simply using the option to create a single form for free- not the 30-day trial). 

    There is no time limit. The limit is the 50 responses.

Maybe you are looking for

  • Comenting code - style - how to keep coments where you want them - without using sequences

    Silly question maybe about style of commenting. Basically i like to use sequence boxes to keep comments on my diagram beside the bits of code that they refere to - otherwise when you use diagram cleanup (which i'm afraid i use all the time) they go a

  • Problem with a file adapter

    Hi, I'm making a scenario using XI 3.0. I use a file adapter (with an inbound synchronous interface) to send a xml file to XI. XI consumes a function from CRM using a RFC adapter and an outbound synchronous interface. The xml file arrives correctly t

  • USB video adapter

    I have a MBpro running the latest OSx 10.8.2. I am wondering any anyone can recommend a stable USB video Adapter. I have recently tried using display link and other such devices however when Mac OS updates the drivers seem to lag on there compatibili

  • Attach documents in Mail no longer works

    I am using Mountain Lion (OS X10.8.2).  It seems several days ago, I lost the ability to attach a document in the Mail app.  Please help

  • Rounded Rectangle Line Weight problem

    I can't make a rounded rectangle with .5pt. It keeps resetting to 1pt. I am also applying a dash (1,1) to the line