Click here to Skip to main content
15,916,091 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: multiforms and objects Pin
Nadroj8-Dec-04 20:46
Nadroj8-Dec-04 20:46 
Generalhelp please Pin
Member 15740198-Dec-04 19:57
Member 15740198-Dec-04 19:57 
GeneralRe: help please Pin
Dave Kreskowiak9-Dec-04 1:01
mveDave Kreskowiak9-Dec-04 1:01 
GeneralRotating pictures Pin
Don128-Dec-04 18:14
Don128-Dec-04 18:14 
GeneralRe: Rotating pictures Pin
Mekong River8-Dec-04 23:09
Mekong River8-Dec-04 23:09 
GeneralDeployment Pin
nitin_ion8-Dec-04 17:21
nitin_ion8-Dec-04 17:21 
GeneralRe: Deployment Pin
Mekong River8-Dec-04 23:13
Mekong River8-Dec-04 23:13 
GeneralData from two tables Pin
Chaos Machine8-Dec-04 16:22
Chaos Machine8-Dec-04 16:22 
Hello everybody. I am trying to retrive data from a Access Database containing two tables.
1) tblKeyword
2) tblArea

In tblKeyword there are two attributes: a) Keyword and b) AreaName
in tblArea there are couple including AreaName which is the connection between the two tables.

I am trying to use the following code:
========================================================================
Dim strConnection As String = OleDbConnection1.ConnectionString
Dim connect As New OleDbConnection(strConnection)
Dim test As String
Dim te As String
Dim SQLString As String
connect.Open()
te = cmbKeywords.Items(cmbKeywords.SelectedIndex)

On Error Resume Next


SQLString = "SELECT tblKeywords.Keyword, tblArea.AreaName, tblArea.StartDate, tblArea.JobNumber FROM tblKeywords INNER JOINT tblArea ON tblKeywords.AreaName = tblArea.AreaName WHERE tblKeyWords.Keyword =" & "'" & te & "'"
Dim cmd As New OleDbCommand(SQLString, connect)
Dim reader As OleDbDataReader = cmd.ExecuteReader()

While reader.Read()
txtAreaName.Text = reader.GetValue(1)
End While
========================================================================

The SQL command goes through OK but the reader.Read is causing an error. How can i retrive the data from that SQL. I am lost. Confused | :confused:

I know that the GetValue gets a value from attributes in one table. But with the inner joint I need values from both tables.

Any help would be appreaciated. Thank you..

Still trying to find the way
GeneralRe: Data from two tables Pin
J4amieC9-Dec-04 2:52
J4amieC9-Dec-04 2:52 
GeneralRe: Data from two tables Pin
Chaos Machine9-Dec-04 10:52
Chaos Machine9-Dec-04 10:52 
GeneralRe: Data from two tables Pin
J4amieC9-Dec-04 23:56
J4amieC9-Dec-04 23:56 
GeneralRe: Data from two tables Pin
Chaos Machine12-Dec-04 10:58
Chaos Machine12-Dec-04 10:58 
GeneralVB6: Form-less app's hwnd Pin
Pablo.ar8-Dec-04 16:16
Pablo.ar8-Dec-04 16:16 
GeneralRe: VB6: Form-less app's hwnd Pin
Dave Kreskowiak9-Dec-04 3:14
mveDave Kreskowiak9-Dec-04 3:14 
GeneralRe: VB6: Form-less app's hwnd Pin
Pablo.ar9-Dec-04 10:56
Pablo.ar9-Dec-04 10:56 
GeneralRe: VB6: Form-less app's hwnd Pin
Dave Kreskowiak9-Dec-04 13:52
mveDave Kreskowiak9-Dec-04 13:52 
GeneralRe: VB6: Form-less app's hwnd Pin
MohammadAmiry9-Dec-04 20:58
MohammadAmiry9-Dec-04 20:58 
GeneralRe: VB6: Form-less app's hwnd Pin
Anonymous9-Dec-04 22:47
Anonymous9-Dec-04 22:47 
Generalicon help Pin
WartHog0008-Dec-04 14:53
WartHog0008-Dec-04 14:53 
GeneralRe: icon help Pin
Pablo.ar8-Dec-04 16:14
Pablo.ar8-Dec-04 16:14 
GeneralRe: icon help Pin
WartHog0009-Dec-04 9:34
WartHog0009-Dec-04 9:34 
GeneralIcon -> Cursor conversion Pin
TAlvord8-Dec-04 13:07
TAlvord8-Dec-04 13:07 
GeneralRe: Icon -> Cursor conversion Pin
Pablo.ar8-Dec-04 16:12
Pablo.ar8-Dec-04 16:12 
GeneralRe: Icon -> Cursor conversion Pin
Mario Zafonte9-Mar-24 22:53
Mario Zafonte9-Mar-24 22:53 
GeneralValue in a Datagrid Cell Pin
bexarcounty8-Dec-04 12:34
bexarcounty8-Dec-04 12:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.