MSAccess query : detect data type

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default MSAccess query : detect data type

    "deleteID" in the following query could be either alpha or numeric.
    How to modify the query to accomodate both cases?

    <CFQUERY datasource="#dsn#">
    delete from #table#
    Where #deleteID#='#Evaluate(deleteID)#'
    </CFQUERY>

    ThankYou

    Conti Guest

  2. Similar Questions and Discussions

    1. Detect CFQuery Column Data Type
      Is it possible to detect the data type of a column in an ODBC Select CFQuery with MS Access or SQL Server? This solution will save me a lot of...
    2. long query time, oracle clob data type
      I am getting some very long query times (+8 hours) on a very simple query where the fields are not null. This is using ColdFusion MX7, just a...
    3. retriving data from memo data type of msaccess to asp.net
      hi all, How i can access the data from MEMO style storage of MS ACCESS using sql query.Can any body give the function ie (Areader.(?)).Which...
    4. ASP - MSAccess (OLE Object Data Type)
      Is it possible for me to retrieve an OLE Object(.JPEG format) datatype and display it on the browser?
    5. Data type query
      Hi I have to specify in a table certain values for: Minutes duration spent on phone-eventduration, the eventdate-which date, and event time- exact...
  3. #2

    Default Re: MSAccess query : detect data type

    You could do something like the code below. If the first delete throws an
    error, the second delete (without the quote marks) will execute.



    <CFTRY>
    <CFQUERY datasource="#dsn#">
    delete from #table# Where #deleteID#='#Evaluate(deleteID)#'
    </CFQUERY>
    <CFCATCH
    <CFQUERY datasource="#dsn#">
    delete from #table# Where #deleteID#=#Evaluate(deleteID)#
    </CFQUERY>
    </CFCATCH>

    jdeline Guest

  4. #3

    Default Re: MSAccess query : detect data type

    I have the same issue but I have several fields and I need to know if they are
    numeric, date, or text data types. I can test the data, but I need to know
    what type of field is in the database column.

    Is there a way to test for the ODBC table columns data type in MS Access and
    SQL Server?

    Thanks.

    GreatBlue Guest

  5. #4

    Default Re: MSAccess query : detect data type

    Conti,

    What kind of variables are #table# and #deleteID#? If they are not local
    variables and are URL or FORM variables instead, this is a potentially
    dangerous query. If the page containing this code has poor security, your user
    could access the page directly and potentially delete information from your
    tables. There is also sql injection to think about.


    mxstu 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