MySQL Forums
Forum List  »  Newbie

Re: Inserting a String containg quotation character.
Posted by: Mario Esgana
Date: June 26, 2005 09:45PM

here is my sub code.

Private Sub cmdadd_Click()
Dim objpv As PV.encrypter
Dim mykey As String
Dim incrpass As String
Dim incruser As String
Dim incrkey As String
Dim sql As String
Dim con As New ADODB.Connection

If txtusername.Text = "" Or txtpassword = "" Or txtkey.Text = "" Then
MsgBox "Please fill-up all the fields!", vbInformation, "Igen Access"
Else
Set objpv = CreateObject("pv.encrypter")
mykey = objpv.Setkey("pvigen")
incruser = objpv.Encryptme(txtusername.Text)
incruser = Replace(CStr(incruser), "'", "''")
incruser = Replace(CStr(incruser), Chr(34), """")
incrpass = objpv.Encryptme(txtpassword.Text)
incrpass = Replace(CStr(incrpass), "'", "''")
incrpass = Replace(CStr(incrpass), Chr(34), """")
incrkey = objpv.Encryptme(txtkey.Text)
incrkey = Replace(CStr(incrkey), "'", "''")
incrkey = Replace(CStr(incrkey), Chr(34), """")
sql = "Insert Into access values('" & incruser & "','" & incrpass & "','" & incrkey & "')"
con.Open "igen"
con.Execute sql
con.Close
Set con = Nothing
Set objpv = Nothing
MsgBox "New access data added!", vbInformation
End If
End Sub

Options: ReplyQuote


Subject
Written By
Posted
Re: Inserting a String containg quotation character.
June 26, 2005 09:45PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.