473,587 Members | 2,550 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

accessing data from table error = no value given for one or more required parameters

5 New Member
My aim is - Access data from table and show it into a form's textboxes , comboxes for edition of data.
I am using listview. I am selecting particular row of listview by clicking on that row and after clicking on toolbar's Button, I want that , the data of entire selected row should show in textbox and comboxes of form. I am doing this by calling a function "Editt()" at toolbar's button click event which are as follows : -

Expand|Select|Wrap|Line Numbers
  1.  
  2. Option Explicit
  3. Public con As ADODB.Connection
  4. Public rs As ADODB.Recordset
  5.  
  6. Public Function conn()  ' for connection 
  7. Set con = New ADODB.Connection
  8. con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\CCMS.mdb;Persist Security Info=False"
  9. con.Open "CCMS.mdb" 
  10. End Function
  11.  
  12. Public Function reco()      ' for recordset
  13. Set rs = New ADODB.Recordset
  14. End Function
  15. ---------------------------------------------------------
  16. This code gives the row no which is selected by you.
  17. Private Sub lvwSchlStud_Click()
  18. If lvwSchlStud.ListItems.Count <> 0 Then
  19. lvwSchlStud.Tag = lvwSchlStud.ListItems(lvwSchlStud.SelectedItem.Index)
  20. End If
  21. End Sub
  22. =========================================================
  23. Function Editt()
  24.  
  25. If lvwSchlStud.Tag <> "" Then
  26.            Call reco   
  27.            rs.Open "select Fname, Lname, Mname, InstName, StdYear, BatchTime, BatchName, BatchType, Gender, ParName, SelfNo, FatherNo, MotherNo, ResiNo, Addr, Email, DOB, Batch, InstType from StudRecord where StudID = " & Int(lvwSchlStud.Tag) & "", con, adOpenStatic, adLockPessimistic
  28.                With frmUpdateStudent
  29.                       .txtFirstName.Text = rs!Fname
  30.                       .txtLastName.Text = rs!Lname
  31.                       .txtMidName.Text = rs!Mname
  32.                       .txtInstName.Text = rs!InstName
  33.                       .cboStdYear.Text = rs!StdYear
  34.                       .cboBtchTime.Text = rs!BatchTime
  35.                       .cboBtchName.Text = rs!BatchName
  36.                       .cboBtchType.Text = rs!BatchType
  37.                       .cboGender.Text = rs!Gender
  38.                       .txtParName.Text = rs!ParName
  39.                       .txtSelfNo.Text = rs!SelfNo
  40.                       .txtFathrNo.Text = rs!FatherNo
  41.                       .txtMothrNo.Text = rs!MotherNo
  42.                       .txtResiNo.Text = rs!ResiNo
  43.                       .txtAddr.Text = rs!Addr
  44.                       .txtEmailID.Text = rs!Email
  45.                       .DT1 = rs!DOB
  46.                       .cboSchlColl.Text = rs!InstType   
  47.                       .cboBtch.Text = rs!Batch      
  48.                End With
  49.  
  50.                       frmUpdateStudent.Show vbModal
  51.         Else: MsgBox "No record is selected!!", vbExclamation, "System Alert"
  52. End If
  53.  
  54. End Function
  55.  
  56.  
This function accessing data from table by using SQL query and putting into respective textbox and comobox Example - txtLastName.Tex t = rs!Lname

VB giving me error at - rs.Open "select Fname, Lname, Mname, InstName, StdYear, BatchTime, BatchName, BatchType, Gender, ParName, SelfNo, FatherNo, MotherNo, ResiNo, Addr, Email, DOB, Batch, InstType from StudRecord where StudID = " & Int(lvwSchlStud .Tag) & "", con, adOpenStatic, adLockPessimist ic

One Important thing i want to tell you that - in listview i am showing data in following way-
StudID, Fname, Mname, Lname, InstName, StdYear, BatchTime, BatchName, BatchType, Gender, ParName, SelfNo, FatherNo, MotherNo, ResiNo, Addr, Email, DOB
Apr 24 '11 #1
0 1083

Sign in to post your reply or Sign up for a free account.

Similar topics

7
6230
by: mp | last post by:
No value given for one or more required parameters. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.OleDb.OleDbException: No value given for one or more required...
3
8820
by: Brian Foree | last post by:
I am developing an ASP.NET application that uses Access 2000 as its backend, and have just started getting the following error on 2 ASP.NET pages that had been working until late last week (and I don't think I made any changes to either page other than changing the user control that creates the header). Server Error in '/myApp' Application....
3
11767
by: Grayscale | last post by:
Hello, When I execute the code below, I get: "Microsoft JET Database Engine (0x80040E10) No value given for one or more required parameters." error message in the first line. Rs.Open "SELECT * From Unvanlar WHERE Unvan = " & kayit8, Con, 3,3 If rs.EOF Then
15
16056
by: Dave | last post by:
I am getting the error above intermittantly with an ASP 3.0 page using an MS Access 2003 database. I have searched Google extensively and found the following possible causes for this error: A field name was spelled incorrectly. One or more of the values was blank. You tried to insert the wrong datatype (e.g. surrounded a numeric value...
0
2413
by: Gwen Crutcher | last post by:
I keep getting the error "No value given for one or more required parameters", but not sure why. Can anyone please look at my code snipet and see if you see any reason why I could be getting this error. I am just trying to update a record using MS Access 2003 as the front end. This code is in VB.NET Private Sub cmdUpdate_Click() On...
0
4582
by: AxleWacl | last post by:
Hi, The below error is what I am receiving. The code im using is below the error, for the life of me, I can not see where any parameter is missing..... Server Error in '/FleetcubeNews' Application. -------------------------------------------------------------------------------- No value given for one or more required parameters. ...
0
7849
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8215
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7973
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6626
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5394
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3844
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1454
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1189
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.