Cannot get data if there is space between words

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Cannot get data if there is space between words

    Via a form (called form1) the user can insert information in to an Access
    database. From other form, I can take the data and read the information, which
    is inserted by
    user via form1. If the user inserts My City1 and MY City2 I CANNOT get the
    info from database. If I change the text (which is stored in Access and is
    inserted by the user) to MYCity1 and MYCity2 or
    MY-City1 and MY-City2 it will be OK.
    Does anybody know what I am missing or doing wrong??
    > ThaX
    Red-Hand Guest

  2. Similar Questions and Discussions

    1. Definition of these words
      Can someone give me a quick & simple definition of the following: Twain Tagged file Gamma ICC Thanks.
    2. How to add a space to string data in datagrid
      hi Gurus, How to add a space to string data using the dataformatstring property ? Is there any other way to do it. Shreyas
    3. Proposed Name Space Geo::Data::* and Class::GeoData
      This is a request for comments and opinions concerning a set of modules I have recently developed. I propose to release the beginning of a large...
    4. replace words with bold words
      Hello I was wondering if you guys could help me solve this using reg exp, i have a searchpage and a variable keywords that holds a number of...
    5. Replace words into a string with a space before or after
      Hello. I've got a string with some words inside, and I'm trying to replace 'select' to 'choose'. ---------------------------------------------...
  3. #2

    Default Re: Cannot get data if there is space between words

    > Does anybody know what I am missing or doing wrong??

    AFAIK, you can't have spaces in DB field names.

    -Darrel


    darrel Guest

  4. #3

    Default Re: Cannot get data if there is space between words

    Darrel,
    What should you do if you must insert a city name as Laoes den Bol into your Access file?
    Red-Hand Guest

  5. #4

    Default Re: Cannot get data if there is space between words

    Darrel,
    What should you do if you must insert a city name as " Laoes den Bol " into your Access file?
    Red-Hand Guest

  6. #5

    Default Re: Cannot get data if there is space between words

    > What should you do if you must insert a city name as Laoes den Bol into
    your Access file?

    Oh...I thought you were referring to the field names. As for data going in,
    spaces are just fine. What kind of datatype is the city field that you are
    trying to insert into? What does your insert query look like? Are you
    wrapping your text in quotes in the query?

    -Darrel


    darrel Guest

  7. #6

    Default Re: Cannot get data if there is space between words

    Here you go !!
    The first form:
    <cfparam name="FORM.LNaam" default="1">
    <cfquery name="Voegstad" datasource="VakInfo">
    SELECT LID
    FROM Land
    WHERE LNaam = '#FORM.LNaam#'</cfquery>
    <cfoutput query="Voegstad">
    LID= #lID#
    <cfset LID = #LID#>
    </cfoutput>

    <body>

    <FORM action="Action.cfm" method="post">

    <p>Type the name of city</p>
    <input name="Snaam" type="text" value="">
    <input name="LID" type="hidden" value="<cfoutput>#LID#</cfoutput>">
    <p> <input name="Next" type="submit">
    </p>
    </form>


    And the Action.cfm is:

    <cfparam name="FORM.LID" default="1">
    <cfparam name="FORM.Snaam" default="1">
    <cfquery name="Check" datasource="VakInfo">
    SELECT LID, Snaam
    FROM Stad
    WHERE LID = '#FORM.LID#'
    And Snaam = '#FORM.Snaam#'
    </cfquery>

    <cfif check.RecordCount>
    <!--- Als er een record gevonden wordt dan bestaat er al een account --->
    <cfset session.bestaand = "True">
    <!--- It`s wrong--->
    <script>
    alert("It`s not right!");
    self.location="Javascript:history.go(-1)";
    </script>

    <cfelse>

    <CFQUERY DATASOURCE="Vakinfo">
    INSERT INTO Stad(
    LID,
    Snaam
    )
    VALUES(
    '#trim(FORM.LID)#',
    '#trim(FORM.Snaam)#'
    )
    </CFQUERY>
    </cfif>

    </body>
    </html>

    As I said I am using Access database with default setting for each fileds .

    Thank you for your reply.

    Red-Hand Guest

  8. #7

    Default Re: Cannot get data if there is space between words

    Nobady knows ??????????????????
    Red-Hand Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139