Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
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  
Old August 17th, 2004, 12:13 AM
caRls caRls is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 1 caRls User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old August 17th, 2004, 01:47 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 18 h 33 m 48 sec
Reputation Power: 180
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

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > error in vb


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway