Budi Santoso <[EMAIL PROTECTED]> wrote:
coba pake vbtosql:taruh ini di modul:Public Enum COL_TYPE
icDATE = 1
icNUMBER = 2
icSTRING = 3
icNON_EMPTY_STRING = 4
End Enum
Public Const scSQ As String = "'"
Public Const scNULL = Null
Public Const scCS As String = ","Private Function DoQuotes(ByVal sData As String) As String
Dim iLast As Integer
Dim sPart As String
If Len(sData) = 0 Then Exit Function
iLast = InStr(sData, scSQ)
While iLast
sPart = sPart & Left$(sData, iLast - 1) & scSQ & scSQ
sData = Right$(sData, Len(sData) - iLast)
iLast = InStr(sData, scSQ)
Wend
sData = sPart & sData
DoQuotes = Trim$(sData)
End FunctionPublic Function VToSQL(ByVal vVar, iType As COL_TYPE) As String
VToSQL = vbNullString
Select Case iType
Case COL_TYPE.icDATE
If vVar Then
VToSQL = CDate(vVar)
Else
VToSQL = scNULL
End If
Case COL_TYPE.icNUMBER
VToSQL = CStr(vVar)
Case COL_TYPE.icSTRING
VToSQL = scSQ & DoQuotes(vVar) & scSQ
Case COL_TYPE.icNON_EMPTY_STRING
If vVar = vbNullString Then
VToSQL = scNULL
Else
VToSQL = scSQ & DoQuotes(vVar) & scSQ
End If
End Select
End Functionnanti carinya bisa dicoba begini:.FindFirst "SLOGAN =" & VToSQL(txtcari.Text, icSTRING)Semoga membantu----- Original Message -----From: Tian ZegaSent: Tuesday, July 12, 2005 11:21 AMSubject: [Programmer-VB] [Help] - Mencari String Yang Mengandung Tanda KutipDear All Programmer-VB,Saya sedang mengembangkan sebuah aplikasi database, dan pada record database tersebut banyak terdapat kata - kata yang mengandung tanda kutip, misalnya AWA'AI, DO'A, JUM'AT, dll. Sebagai informasi, dalam melakukan pencarian untuk beberapa tabel yang menggunakan metode FindFirst, FindNext, dan juga metode filtering.Yang menjadi masalah adalah, pada saat melakukan pencarian dengan metode FindFirst, dimana saya mau mencari string AWA'AI yang pada contoh telah saya input pada textbox txtcari.Text pada Tabel CARI pada field SLOGAN seperti contoh :With datcari.Recordset.FindFirst "SLOGAN ='" & txtcari.Text & "'"If Not .NoMatch Then'isi commandEndifEnd Withakan selalu tampil "Syntaks Error". Saya mengerti bahwa pencarian tipe data String harus dibuka dan ditutup dengan karakter ' . Tetapi bagaimana jika dalam sebuah string terkandung karakter tersebut.Sebelumnya saya ucapkan terima kasih. Saya harapkan bantuan dan sarannya.Regards All VB ProgrammerTZ.__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Untuk keluar dari millis ini, kirim email kosong ke:
[EMAIL PROTECTED]
---- LSpots keywords ?>---- HM ADS ?>
Untuk keluar dari millis ini, kirim email kosong ke:
[EMAIL PROTECTED]
---- LSpots keywords ?>---- HM ADS ?>
--------------------
* LEGAL DISCLAIMER *
--------------------
This message is for information purposes only and its content should not be construed as an offer, or solicitation of an offer,to buy or sell any product or services and no representation or warranty is given in respect of its accuracy, completeness or fairness. The material is subject to change without notice. This message may contain confidential or legally privileged material and may not be copied, redistributed or published (in whole or in part) without our prior written consent.
This email may have been intercepted, partially destroyed, arrive late, incomplete or contain viruses and no liability is accepted by any member of the Martha Tilaar Group as a result. If you are not the intended recipient of this message, please immediately notify the sender and delete this message from your computer.
Yahoo! Mail for Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
Untuk keluar dari millis ini, kirim email kosong ke:
[EMAIL PROTECTED]
---- LSpots keywords ?> ---- HM ADS ?>
YAHOO! GROUPS LINKS
- Visit your group "Programmer-VB" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
