Das ist schon klar. Von der Taktik wollte ich Dich auch nicht abbringen. Was ich in dem Beispiel als Feld1, Feld2 bezeichnet habe baust Du genau mit Deinem vorhandenen Ansatz dynamisch zur Laufzeit zusammen. Dass das ein bischen Arbeit ist, sollte klar sein. Sorry about ;-)
Dann �berleg mal, was kommt raus, wenn Du einen Integer nach "%ler" durchsuchst. Der User k�nnte aber sehr wohl auf die Idee kommen nach "123" suchen zu wollen und k�nnte dann f�ndig werden wenn alle Datentypen nach String umgewandelt sind. Siehe letztes Beispiel. Dann wie krieg ich den Typen raus? Also wenn ich die Doku richtig verstehe dann mit .type OK das h�tten wir uns auch denken k�nnen. Angeblich kommt da eine Typnummer aus dem unten angeh�ngten Set raus. Ich w�rde sagen probier es einfach mal aus. Constant Value Description AdArray (Does not apply to ADOX.) 0x2000 A flag value, always combined with another data type constant, that indicates an array of that other data type. adBigInt 20 Indicates an eight-byte signed integer (DBTYPE_I8). adBinary 128 Indicates a binary value (DBTYPE_BYTES). adBoolean 11 Indicates a boolean value (DBTYPE_BOOL). adBSTR 8 Indicates a null-terminated character string (Unicode) (DBTYPE_BSTR). adChapter 136 Indicates a four-byte chapter value that identifies rows in a child rowset (DBTYPE_HCHAPTER). adChar 129 Indicates a string value (DBTYPE_STR). adCurrency 6 Indicates a currency value (DBTYPE_CY). Currency is a fixed-point number with four digits to the right of the decimal point. It is stored in an eight-byte signed integer scaled by 10,000. adDate 7 Indicates a date value (DBTYPE_DATE). A date is stored as a double, the whole part of which is the number of days since December 30, 1899, and the fractional part of which is the fraction of a day. adDBDate 133 Indicates a date value (yyyymmdd) (DBTYPE_DBDATE). adDBTime 134 Indicates a time value (hhmmss) (DBTYPE_DBTIME). adDBTimeStamp 135 Indicates a date/time stamp (yyyymmddhhmmss plus a fraction in billionths) (DBTYPE_DBTIMESTAMP). adDecimal 14 Indicates an exact numeric value with a fixed precision and scale (DBTYPE_DECIMAL). adDouble 5 Indicates a double-precision floating-point value (DBTYPE_R8). adEmpty 0 Specifies no value (DBTYPE_EMPTY). adError 10 Indicates a 32-bit error code (DBTYPE_ERROR). adFileTime 64 Indicates a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (DBTYPE_FILETIME). adGUID 72 Indicates a globally unique identifier (GUID) (DBTYPE_GUID). adIDispatch 9 Indicates a pointer to an IDispatch interface on a COM object (DBTYPE_IDISPATCH). Note This data type is currently not supported by ADO. Usage may cause unpredictable results. adInteger 3 Indicates a four-byte signed integer (DBTYPE_I4). adIUnknown 13 Indicates a pointer to an IUnknown interface on a COM object (DBTYPE_IUNKNOWN). Note This data type is currently not supported by ADO. Usage may cause unpredictable results. adLongVarBinary 205 Indicates a long binary value. adLongVarChar 201 Indicates a long string value. adLongVarWChar 203 Indicates a long null-terminated Unicode string value. adNumeric 131 Indicates an exact numeric value with a fixed precision and scale (DBTYPE_NUMERIC). adPropVariant 138 Indicates an Automation PROPVARIANT (DBTYPE_PROP_VARIANT). adSingle 4 Indicates a single-precision floating-point value (DBTYPE_R4). adSmallInt 2 Indicates a two-byte signed integer (DBTYPE_I2). adTinyInt 16 Indicates a one-byte signed integer (DBTYPE_I1). adUnsignedBigInt 21 Indicates an eight-byte unsigned integer (DBTYPE_UI8). adUnsignedInt 19 Indicates a four-byte unsigned integer (DBTYPE_UI4). adUnsignedSmallInt 18 Indicates a two-byte unsigned integer (DBTYPE_UI2). adUnsignedTinyInt 17 Indicates a one-byte unsigned integer (DBTYPE_UI1). adUserDefined 132 Indicates a user-defined variable (DBTYPE_UDT). adVarBinary 204 Indicates a binary value (Parameter object only). adVarChar 200 Indicates a string value (Parameter object only). adVariant 12 Indicates an Automation Variant (DBTYPE_VARIANT). Note This data type is currently not supported by ADO. Usage may cause unpredictable results. adVarNumeric 139 Indicates a numeric value (Parameter object only). adVarWChar 202 Indicates a null-terminated Unicode character string. adWChar 130 Indicates a null-terminated Unicode character string (DBTYPE_WSTR). -- Viele Gr��e Hubert Daubmeier -----Original Message----- From: Michele Marsching [mailto:[EMAIL PROTECTED]] Sent: Saturday, May 18, 2002 1:38 PM To: ASP Diskussionsliste fuer Anfaenger Subject: [aspdebeginners] AW: [aspdebeginners] Re: [aspdebeginners] AW: [aspdebeginners] Re: [aspdebeginners] SQL SELECT �BER ALLE FELDER? Das einfache durchsuchen geht deswegen nicht, weil ich die DB nicht kenne (ist von einer anderen Person gemacht und suuuuuper gro� und suuuuuuper un�bersichtlich und suuuuuuper sinnlos). Ich werde mich mal um ADO bem�hen, weil ich denke, das einzige, was noch fehlt, ist dem Skript zu sagen IF feldatentyp=INTEGER THEN DO NOTHING ELSE BEGIN VERGLEICH END IF :-) Beste Gr��e | Michele Marsching Application Development KlickTick.de * Internetservices & -consulting http://www.klicktick.de [EMAIL PROTECTED] # -----Urspr�ngliche Nachricht----- # Von: Hubert Daubmeier [mailto:[EMAIL PROTECTED]] # Gesendet: Freitag, 17. Mai 2002 19:12 # An: ASP Diskussionsliste fuer Anfaenger # Betreff: [aspdebeginners] Re: [aspdebeginners] AW: [aspdebeginners] Re: # [aspdebeginners] SQL SELECT �BER ALLE FELDER? # # # > Wir sehen: ein Fehler mit dem Datentyp in einer der DB-Spalten. # Wie kriege # > ich jetzt den Datentyp in der jeweiligen Spalte raus, damit ich # einen Int # > nicht mit einem String vergleiche? Zu H�lf! # # # Es passiert ja folgendes: Du durchsuchst Feld1 und findest was. Dann # Ausgabe. Dann Feld2 und ggf. wieder Ausgabe. Sprich die ganze Liste wird # hinterher ziemlich wirr zusammengesetzt. Warum gehst Du nicht her # und baust # zuerst einen Superstring und l�sst den durchsuchen? Also etwa # # SELECT # feld1, feld2, feld2 # FROM # tabelle # WHERE # id in # ( # SELECT # id # FROM # ... # WHERE # feld1 + feld2 + feld3 like '%ler' # ) # # Was hier noch passieren k�nnte ist das Suchbegriff in den Grenzen zwischen # den Feldern zu holen ist. Etwa "l" im feld1 und "er" im feld2. # Das k�nntest # Du unterbinden, wenn Du noch irgendein kryptische Trennzeichen # mit einbaust. # Liese sich etwa so l�sen # # SELECT # feld1, feld2, feld2 # FROM # tabelle # WHERE # id in # ( # SELECT # id # FROM # ... # WHERE # feld1 + '|' + feld2 + '|' + feld3 like '%ler' # ) # # Und nat�rlich ist damit Dein IntegerProblem noch nicht erschlagen. Wie Du # das genau ausliest weiss ich grade nicht - steht aber sicher in der Docu. # Durchsuch einfach mal Deine Platte nach *.CHM. Alles was # irgendwie mit ADO # zu tun hat ist ein guter Kandidat. Da musstest Du nat�rlich noch richtig # konvertieren. Womit wir etwa da sind # # SELECT # feld1, feld2, feld2 # FROM # tabelle # WHERE # id in # ( # SELECT # id # FROM # ... # WHERE # feld1 + '|' + convert(char, intfeld2) + '|' + feld3 like '%ler' # ) # # # oder bei Access # # WHERE # feld1 + '|' + FormatNumber(intfeld2) + '|' + feld3 like '%ler' # ) # # # -- # # Gru� # Hubert # # # # | Oft Gefragtes: http://www.aspgerman.com/aspgerman/faq/ # | [aspdebeginners] als [EMAIL PROTECTED] subscribed # | http://www.aspgerman.com/archiv/aspdebeginners/ = Listenarchiv # | Sie knnen sich unter folgender URL an- und abmelden: # | http://www.aspgerman.com/aspgerman/listen/anmelden/aspdebeginners.asp # | Oft Gefragtes: http://www.aspgerman.com/aspgerman/faq/ | [aspdebeginners] als [EMAIL PROTECTED] subscribed | http://www.aspgerman.com/archiv/aspdebeginners/ = Listenarchiv Sie | knnen sich unter folgender URL an- und abmelden: | http://www.aspgerman.com/aspgerman/listen/anmelden/aspdebeginners.asp | Oft Gefragtes: http://www.aspgerman.com/aspgerman/faq/ | [aspdebeginners] als [email protected] subscribed | http://www.aspgerman.com/archiv/aspdebeginners/ = Listenarchiv | Sie knnen sich unter folgender URL an- und abmelden: | http://www.aspgerman.com/aspgerman/listen/anmelden/aspdebeginners.asp
