try to use the debugging feature of vb6...it helps a lot...
try to use the debugging feature of vb6...it helps a lot...
unsa connection gamit nimo bro? basin naa problema sa connection nimo? and unsa database na gamit.. ?
try pud basin naa ka error filter like ON ERROR RESUME NEXT mao d cya ma save
Private Sub cmdRetrieve_Click()
Dim rs As New ADODB.Recordset
rs.Open "SELECT * from user_act WHERE id > " & txtid.Text, Conn, adOpenForwardOnly, adLockPessimistic
If Not rs.EOF Then
txtid.Text = rs!id
'txtpassword.Text = rsSearch!Password
txtuname.Text = rs!uname
txtpassword.Text = rs!Password
Else
LastID = 0
End If
rs.Close
Private Sub cmdDelete_Click()
If txtID.Text = "" Then
MsgBox "Please enter an ID number!", vbCritical
Exit Sub
End If
Dim rs2 As New ADODB.Recordset
ans = MsgBox("Do you really want to delete this record?", vbYesNo, Me.Caption)
If ans = vbYes Then
rs2.Open "DELETE FROM MIDTERM WHERE ACT_ID='" & txtID.Text & "'", Conn, 1, 2
MsgBox "Record Deleted"
clear
End If
End Sub
ex.. 0001 was successfully delted pero ika retrieve na ko mo balik na sad 0001.unsa problema ani bro
'what data type anang ACT_ID nga field
'kung String or Text:
rs2.Open "DELETE FROM MIDTERM WHERE ACT_ID='" & txtID.Text & "'", Conn, 1, 2
'if Number:
rs2.Open "DELETE FROM MIDTERM WHERE ACT_ID=" & txtID.Text, Conn, 1, 2
'then try ichange nga 1 ug 2 sa adOpenDynamic ug adLockOptimistic
Kung Access imo DB, Ingon ani ang Pag insert.
kung date ang field na insertan: #" & txtDate.text "# tangtanga ang single qoutes.
kung number ang field na insertan: " & txtid.text & " tangtanga ang single qoutes.
kung string ang field na insertan: '" & txtPassword.text & "' Kana naay single qoutes.
Happy Coding!
bro. timan-e lang jud basta string or character gani imong isulod sa query string, single quote rana sya.
-2010 Cebujobline.com Team
Similar Threads |
|