BTC USD 84,425.2 Gold USD 4,289.50
Time now: Jun 1, 12:00 AM

minta tolong pasal error dalam visual basic 6.0

faizulit

Junior Member
Messages
61
Joined
Oct 4, 2009
Messages
61
Reaction score
0
Points
6
sape kat sini yg otai mengenai programming visual basic 6.0 mintak pendapat mengenai error yg sy hadapi sekarang ni

msg dalam error ni tulis
"Run TIme 3705
Operation is not allowed when the object is open"

sy rase ralat ni dalam SEARCH button dimana sambungan dari visual basic 6.0 (interface) and access database

kali pertama search tak ada masalah, tpi bile second time search ade error run time 3705 pulak.

sy lampirkan sekali coding mengenai button search tu

Code:
Private Sub Command2_Click()
DataEnvironment1.Search Text1.Text
With DataEnvironment1.rsSearch

If Text1.Text = "" Then
Unload Me
MsgBox "Dont lets this text box empty, if empty you will terminate immediately", vbCritical
End

ElseIf DataEnvironment1.rsSearch.EOF Then
MsgBox "Sorry Not Found", vbCritical

Else
MsgBox "Found", vbInformation
Text1.Text = DataEnvironment1.rsSearch.Fields("MATRIK")
Text2.Text = DataEnvironment1.rsSearch.Fields("NAMA")
Text3.Text = DataEnvironment1.rsSearch.Fields("NOIC")
Text4.Text = DataEnvironment1.rsSearch.Fields("GENDER")
Text5.Text = DataEnvironment1.rsSearch.Fields("RELIGION")
Text6.Text = DataEnvironment1.rsSearch.Fields("RACE")
Text7.Text = DataEnvironment1.rsSearch.Fields("ADDRESS")
Text8.Text = DataEnvironment1.rsSearch.Fields("CONTACT")
Text9.Text = DataEnvironment1.rsSearch.Fields("EMAIL")
Text10.Text = DataEnvironment1.rsSearch.Fields("POINTER")
End If
Close
End With
End Sub

sy dah cube pelbagai method tp mengecewakan, harap kat sini ade solution dari otai CG sendiri. TK
 
Cuba

Private Sub Command2_Click()
Close
coding.......

Saya x mahir VB nih kerana database saya pakai Visual FoxPro.... saja nak soh awak cuba ... :D
 
Last edited:
dah cuba letak close ataupon end kat bawah private Command2_Click tu
problem still the same


anyway thanks for the effort. :)
 
dah cuba letak close ataupon end kat bawah private Command2_Click tu
problem still the same


anyway thanks for the effort. :)

Error tuh menunjukkan saudara kena close semua object ... bermakna sebelum buka kena close dulu dan habis coding kena close lagi ... Saya x tau apa command yang sesuai ... jika VFP ada command clear all atau close all
 
try tukar Close kepada rsSearch.Close

aku pun tak tau.. ehehehe
 
error jugak en.akukurt
error tu betul2 kat .Close tu. :D

thanks for the respons :D
 
Saya tak tahu sgt ngan VB nie tp kalau tgk coding dan logik, nampak mcm if else statement tak close bebetul kot

kat if statement pertama ade 'END' statement, kalau taksalah la bukan ke formatnya:

IF statement Then
commadn
ELSEIF statement then
ELSE
END IF

cuba TT try
 
ouh. dekat IF statement tu ade code END sbb nak exit the program if text box tak ada tulis apa2 (null)

masih lagi tiada penyelesiannya susah tol nak cari error ni
bile debug die betol2 label kat perkataan ni
"DataEnvironment1.Search Text1.Text"
 
aku pom lama tak men VB neh..cuba neh...
"DataEnvironment1.Search = Text1.Text"
 
Back
Top
Log in Register