D
David Eadie
G'Day all,
Heres my code: (watch for wrapping)
'MDB Connection and open
Dim MDBConnection
Dim MDBConnString As String =
"Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=example.mdb"
MDBConnection = New OleDbConnection(MDBConnString)
MDBConnection.Open()
'Open table from database
Dim MDBRead As New OleDb.OleDbCommand("SELECT * FROM
Accounting WHERE UserName = '" + TextBox1.Text + "'", MDBConnection)
Dim MDBReader As OleDbDataReader
'While reading MDB put the required data into label or textbox
MDBReader = MDBRead.ExecuteReader
While MDBReader.Read()
array
End While
'Close MDB Connection
MDBReader.Close()
MDBConnection.Close()
My database is an Access Database and has a table called "Accounting"
in it.
In that table there exists 5 columns in order called: ID, Username,
Firstname, Lastname, Password. ID is set to autonumber and the rest
are just plain text.
Now where the >>>>>> line is above in the code it will return the "ID"
field from my database. If I change the 0 to a 1 it will return the
username field and if I change it to a 2 it will return the firstname
field ect...
What I want to return is the Username, Firstname, Lastname and
Password fields together without the ID field.
Iv frigged around with the .getvalues method but it appears Im barking
up the wrong tree and I have searched msdn and google groups but I
just cant seem to figure out something so simple..
Please help I'll keep you posted on my progress.
Cheers
Dave.
Heres my code: (watch for wrapping)
'MDB Connection and open
Dim MDBConnection
Dim MDBConnString As String =
"Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=example.mdb"
MDBConnection = New OleDbConnection(MDBConnString)
MDBConnection.Open()
'Open table from database
Dim MDBRead As New OleDb.OleDbCommand("SELECT * FROM
Accounting WHERE UserName = '" + TextBox1.Text + "'", MDBConnection)
Dim MDBReader As OleDbDataReader
'While reading MDB put the required data into label or textbox
MDBReader = MDBRead.ExecuteReader
While MDBReader.Read()
array
End While
'Close MDB Connection
MDBReader.Close()
MDBConnection.Close()
My database is an Access Database and has a table called "Accounting"
in it.
In that table there exists 5 columns in order called: ID, Username,
Firstname, Lastname, Password. ID is set to autonumber and the rest
are just plain text.
Now where the >>>>>> line is above in the code it will return the "ID"
field from my database. If I change the 0 to a 1 it will return the
username field and if I change it to a 2 it will return the firstname
field ect...
What I want to return is the Username, Firstname, Lastname and
Password fields together without the ID field.
Iv frigged around with the .getvalues method but it appears Im barking
up the wrong tree and I have searched msdn and google groups but I
just cant seem to figure out something so simple..
Please help I'll keep you posted on my progress.
Cheers
Dave.