473,378 Members | 1,434 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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

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.Text = 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, adLockPessimistic

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 1073

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

Similar topics

7
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...
3
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...
3
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...
15
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...
0
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...
0
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'...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.