|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
error in vb
halo...
i'm a novice in using vb. now, i create 1 system. in this system system i must have registration, find, update ang delete function. so, now i have problem in delete data. i found an error: too few parameters. expected 1, when i run the system. why??? i try to solve this problem. but, i fail.... please help me..... here i also send coding this delete form. Dim RSSTUDENT As Recordset Dim DBSTUDENT As Database 'Dim RSSTUDENT1 As Recordset 'Dim DBSTUDENT1 As Database Private Sub Command2_Click() Form1.Show Unload Me End Sub Private Sub Form_Load() Dim DataBaseFile As String Dim DataBaseFile1 As String DataBaseFile = App.Path & "\akdipdb.mdb" 'DataBaseFile1 = App.Path & "\daftar.mdb" 'Dim databasepassword As String 'databasepassword = "shekhar" Set DBSTUDENT = OpenDatabase(DataBaseFile, False, False) 'Set DBSTUDENT1 = OpenDatabase(DataBaseFile, False, False, ";pwd=" & databasepassword) End Sub Private Sub xpbutton2_Click() DBSTUDENT = "SELECT * FROM maklumat WHERE IC LIKE '" & Text6.Text & "'" 'Set RSSTUDENT1 = DBSTUDENT1.OpenRecordset("SELECT * FROM daftar WHERE IC='" & Text6.Text & "'", dbOpenDynaset) answer = MsgBox("Adakah Anda Pasti Untuk Hapus Data Ini", vbOKCancel + vbExclamation, "URUSETIA PENERANGAN KERAJAAN NEGERI KELANTAN") If answer = vbOK Then RSSTUDENT.Delete Text1.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Text5.Text = "" Text6.Text = "" Text7.Text = "" Text8.Text = "" End If End Sub Private Sub Command3_Click() Dim STUDENT As String Dim answer As String 'STUDENT = "SELECT * FROM maklumat WHERE IC LIKE '" & Text6.Text & "'" (......an error was here......) Set RSSTUDENT = DBSTUDENT.OpenRecordset("SELECT * FROM maklumat WHERE IC LIKE '" & Text6.Text & "'", dbOpenDynaset) If Trim(Text6.Text) = "" Then Beep answer = MsgBox("Masukkan Data Anda, OK", vbOKOnly + vbCritical, "URUSETIA PENERANGAN KERAJAAN NEGERI KELANTAN") Text1.SetFocus Exit Sub End If If Not (RSSTUDENT.BOF And RSSTUDENT.EOF) Then Do While Not RSSTUDENT.EOF Text1.Text = RSSTUDENT.Fields(0) Text2.Text = RSSTUDENT.Fields(1) Text3.Text = RSSTUDENT.Fields(2) Text4.Text = RSSTUDENT.Fields(3) Text5.Text = RSSTUDENT.Fields(4) Text6.Text = RSSTUDENT.Fields(5) Text7.Text = RSSTUDENT.Fields(6) Text8.Text = RSSTUDENT.Fields(7) RSSTUDENT.MoveNext Loop Text1.Enabled = True Text2.Enabled = True Text3.Enabled = True Text4.Enabled = True Text5.Enabled = True Text6.Enabled = True Text7.Enabled = True Text8.Enabled = True End If End Sub |
|
#2
|
|||
|
|||
|
Usually this error is from a mis-typed column name in your sql.
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > error in vb |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|