Query Access Database - Search Username And Display Student Record

Mar 7, 2012

I'm creating a rewards system for school where pupil earn points for good behavior which they can then use to purchase things like a packet of pens. (They can also have points deducted for bad behavior). I've created all the forms and now its just getting the data in from the Access database. This is what I need to do. On my form called detailsPupil it shows various information such as Name, email address, last login etc. This form is loaded once the pupil has logged in.

Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click
Dim Login = Me.StudentTableAdapter1.UsernamePasswordString(txtUsername.Text, txtPassword.Text, cboPermissions.Text)
If Login Is Nothing Then
MsgBox("Incorrect Username or Password")
[Code] .....

That all works but I'm having problems working out how to get the information like Name and email address into their places. This is what I have so far on my detailsPupil form.
Public Class detailsPupil
Private Sub btnLogOut_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogOut.Click
Login.Show()
[Code] .....

So to sum up I need to run a query which searches the DB using the Username which is obtained from the login form and then displays the Student Name in txtName, Email address in txtEmail etc...

View 1 Replies


ADVERTISEMENT

Access Database Query : Get The Old Record To Be Added To The New Record?

Apr 15, 2012

I have a access database with these columns. USER_ID,COUNT,TIMES

Let say the current record is this:
USER_ID,COUNT,TIMES
STEVE20,24,1.5

Now I want to updated the current count record and times, but before updating I want the old record to be added to the new record. What should be my query?

View 6 Replies

Search Record In Access Database?

May 14, 2011

make vb code in access to search record in my database as following

Field names
1TagNumber
2date calibrated date
3duedate

View 1 Replies

Display All Records From Database In Gridview / If I Search For Particular Record Then Also Performs

Dec 3, 2010

I want to display all records from database in gridview when pageload and also i wanna search for particular record using textbox appear in my webform...Means by default all records from the table will appear in gridview using sqldatasource and i also wanna search for a particular record by enter ID in text box...

View 1 Replies

Query To Search An Access Database?

Mar 25, 2009

I am using MS access 2003 and Visual Basic.net 2010. I have made a query with the SQl code below. I have set my search button's click to fillbylastname which is my query name. My question is, how do I get it search my database with textbox2's text?uery:WHERE ([Last Name] LIKE '@LastName = %')

View 3 Replies

Create Small Database Which Handles Student Attendance Record - Repeating The Data Again And Again ?

Feb 6, 2009

I want to create small database which handles Student Attendance Record it will store the roll calls of students on daily basis that teachers collect from the students in the class on paper and then later transfer it on computer .So my database Must contain Month, Year, Program (BCS, BIT, MS, MCS, MIT etc) Batch (1st, 2nd etc) and Subject (English, Math, Geography etc)

Suppose I want to Search for the Attendance Sheet of any month, year, Program, Batch or Subject, it returns me the required dataSo i come up with the Datadase which includes 5 dimension tables and one fact tableDimension Tables1. Student (StudentID, Name, other Attributes)2. Program (Program_Name, other Attributes)3. Date (Date, Week, Month, Year)4. Batch (Batch_Number, Description)5. Subject (Subject_Name, other Attributes)Fact TableAttendanceTable ( StudentID, Program, Date, Batch, Subject, Status)but the problem come when certain columns are repeating again and again which is time consuming for database operator and shows inconsistent behaviour of database.

Look at it: my Fact table would be like this [code]....

problems:1. The StudentId is repeating which shouldn't (Primary Key),2.It wastes a lot of time coz i'm repeating the data again and again Like Program, Date and Batch which shouldn't be in consistent Databases.

View 7 Replies

Asp.net - Re-edit This Query To Delete Whole Record From Table1 Using Username From Gridview Cell 4?

Dec 15, 2010

can any one re-edit this query to delete whole record from table1 using username from gridview cell 4 ... ?

Imports System.Data.SqlClient
Dim con As New SqlConnection
Dim cmd As New SqlCommand

[code]....

View 2 Replies

Search MS Access Database To Display Data From Differ?

Jun 17, 2009

how to search MS access database using vb.net to display my data from differ i have use this code by it not function. i want to search database using a button and a textbox.. but when i insert a column header of my database into the textbox, it can't show me all data from database.

Protected Sub cmdSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdSearch.Click
Dim InputStr As String = txtsearch .Text

[Code].....

View 1 Replies

Display Record From Table To Gridview On Page Load And Also Search Record For Particular Fields Using Textbox.

Jan 23, 2011

My database : table1

ID FIRSTNAME AGE
1 Sumit 22
2 Sanjeev 23

i have gridview 1 and textbox1 and button1 i want when pages load the gridview displays the all records from table1 and also ...i i wanna search record for firstname by typing sumit in textbox1 and click on button1 then in gridview the record of sumit will be shown ..by default gridview display alll records from table1 How to do this My Selct Query is below : but it doesnot display all record ...but it can display record if you search for a particular record .

[Code]...

View 1 Replies

Query Access Database And Display Data On New Form?

Sep 6, 2010

I have a program in which I want to have the user enter two percentages and display the data matching the criteria on a new form. The query would be:

Select *
From Corrosion
Where corrpct1 >= {column in database} OR
corrpct2 >= {column in database}

The way I currently have it written is to display only one row of data. I need to display any number of rows that meet this criteria. My current code is:

Private Sub btnDetails_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDetails.Click
Dim form As New frmDetails()
Me.Hide()

[code]....

1. How can I do my query to incorporate the user entered criteria (in the where statement)?

2. How can I display ALL of the data instead of just one line?

View 1 Replies

Make A Search Button With It To Search For Student Id?

Jun 21, 2010

i have 1button,1textbox,1datagridview.i want to make a search button with it to search for student id..i use ms access..example i type 12-200705-0005 on the textbox,then i click search button,then the data with student id will show at datagridview..

View 1 Replies

VB 2010 - Search The Database To Verify User Username And Password

Mar 17, 2011

working on a March Madness Program and need help searching the database. I have the database all linked and all the cells connect, but now I need to make it so when people login it will search the database for their username and password to verify the user. My database is in access is called MarchMadness, with the table being tblUser and the column's are "username" and "password"

View 2 Replies

Display A Record From Database And Also The Picture For That Record In A .rdlc Report?

May 23, 2010

I have records in a database. Each record has a Picture path in it eg. "C:\Pics\Image1.jpg". I would like to display a record from my database and also the picture for that record, in a .rdlc report in vb .net 2008. i have succeded in displaying the record but just can't get the picture to show. I am using an Imagebox in the report.

View 2 Replies

Search And Display A Record From Text File In .net CE

Jan 7, 2009

I want to load a text file (a item master with 7 fields line by line) in windows CE 5.0 and search a item no. then display the record of this item no. from text file. how to search a record from a two-dimensional array, when matching, display the record.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim parser As IO.TextReader = System.IO.File.OpenText("C:\qstck.txt")
Dim FileLines() As String = Split(parser.ReadToEnd(), vbCrLf)

[Code]....

View 1 Replies

DB/Reporting :: Display Single Record From Linq Query?

Mar 24, 2011

For a school programming project we are supposed to create a database with 2 tables country, and continent.then we populate country with every country name, population and continentID. For continent we populate with each continent name.

i have completed this step, and i am able to run a linq query to display all countries and corresponding continent into a datagridview. My problem arises because we are supposed to display each record one at a time, and be able to cycle through one at a time. I cannot for the life of me figure out how to do this.

for example if i made a query to select all countries in africa, i want to beable to display the name of the country, and population in textboxes. then have a next button that will go to the next record.

View 2 Replies

Sql - ASP.NET - .NET - Getting Data From MS-Access Database Where Username =?

May 8, 2012

I'm using Web Developer 2010, ASP.NET with the VB.NET programming language and a MS-Access database (.mdb).What I want to do is get all the data from a table called User (i.e. all the columns) where Username = ____, and then put the values in from the fields into text boxes so they can be edited. This is to make a 'My Account' page so that a user viewing the website can change his address, password etc.

I'm stuck at getting the data from the fields for each specific username.What I've done so far is this, but doesn't work:

Imports System.Data.OleDb
Imports System.Data.SqlClient
Imports System.Data

[code]....

View 2 Replies

SQL Search Query To Access DB?

Sep 15, 2011

I'm attempting to query an Access database using a search button from a textbox and insert the results into a listbox. Here's the code I have so far:

[Code]...

The problem I'm having is it's returning the both InstName and the StuName multiple times in the listbox. I'm guessing it's because I'm doing the items.add twice? I was trying to use "[oledbcommand variable name].parameters.addwithvalue" but I couldn't figure out how to do it with a "like" function.

View 1 Replies

Check If Username Already Taken Or Exist On The Access Database?

Mar 29, 2011

how i can check if username already taken or exist on the access database using vb2008

View 2 Replies

Program Look For A Username In A Access Database(.accdb)?

May 3, 2011

The database is a different file.

View 2 Replies

Verify Username Password From Access Database?

May 21, 2010

Login form in vb.net coding to verify username password from access database

View 3 Replies

Asp.net - Search A Record From Sql Database Searching By First Name?

Sep 8, 2009

i want to search a record from sql database searching by first name so im using a function in the data layer but it is not working

Public Function searchCustomer(ByVal custFname As String) As DataTable
Dim tabletdata As New DataTable
Dim conn As New SqlConnection(con_string)

[code]....

View 1 Replies

Cannot Search A Database For More Than One Matching Record?

Dec 12, 2010

I have a textbox for searching a database. When the text changes it runs a functioncFilter() and loads the records. It is set up to search different columns of a database, and it unfortunately only the first record matching is pulled from the database. Example: when the database contains two people (Bob Smith & Bob Smitt) the user can type the name in the search field. However When the user types Bob Smit it only returns Bob Smith and not both names in the database. I want this to act as a filter, dynamically changing the last with each additional letter typed in the search box. Below is my source code,

Public Sub cFilter()
Dim myConnectionstring As String = ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & My.Settings.dbLocation & ";Persist Security Info=True;Jet OLEDB:Database Password=BCFAdmin")

[code].....

View 4 Replies

How To Search A Record In A Database By Specifying First Date

May 21, 2011

how can i search a record in a database by specifying the range between the two dates using two date time pickers the first date time picker is to display the start date and the second to display the end date b the records are to be displayed in a list view below is a code attached that am currently using [code]

View 14 Replies

VB 2010 - How To Search Database For Record

Mar 27, 2011

The form it is on is frmMidwest.vb, the database is MarchMadnessDB, with the table being tblMidwest and the column being Username. I am trying to get it so when the user loads frmMidwest.vb it will then check the database to see if the user has entered their picks and if they have it will load their picks back into frmMidwest.vb if the database cannot find their user then it needs to add a record to the database and allow the user to enter their picks. I have already established this with
TblMidwestBindingSource.AddNew()
But if the user exists I do not want them to be able to enter another record. The primary key in the database is the username.

View 1 Replies

Access Database And Using A Parameter Query With The LIKE Operator To Return All Rows That Match Query?

Apr 28, 2010

I am connecting to an Access database and using a parameter query with the LIKE operator to return all rows that match query. The string to search for is taken from a Textbox

sql =

"Select * FROM Allview WHERE Info Like" &
"*" &
CStr(TextBox1.Text) &
"*"
The query does not return any data in vb, but when run from access with same string, there is data returned.The connection to the database is done correctly, as I am able to return data with various other queries.

Partial code :
Dim
con As
New OleDb.OleDbConnection[code]....

View 8 Replies

How To Search Existing Record In Database Vb 2008

Jun 22, 2010

I have text box and button when i clik tht button it has to display all the data if it is relevent to the data else it has to say no data . my project is about track cd. name textbox that i want to search is txtTitle.

i want something like search forum in this website when u clik on search it will get the data same way i need the solution either it is from database or index service

View 4 Replies

Search A Record In Database In Sql Server 2000?

Apr 7, 2010

i was wondering what i have to do for search a record in my database in sql server 2000?

View 1 Replies

Search Record In Database Using Gridview And Two Textboxes?

Dec 3, 2010

I have two textboxes Textbox1 and Textbox2 and 1 gridviewi want my site users may search record either by entering the city name in textbox1 or by entering the country name on textbox2 via gridview

View 1 Replies

Search Database SQL Like Query

Apr 7, 2011

I have created a bookshop website with database, I need a search engine that will search the database records and present the user with results according to the keyword.I have created the page with the text search box and search button.[code]

View 2 Replies

Query - Table Of Student Information - Produce The Results ?

May 4, 2012

I have a table of student information. Each student has a contact date and a source of information.

I want to produce the results like this

CODE:

At the moment I am using this sql

CODE:

But my results are like this

CODE:

It is just putting the total not the seperate amounts.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved