Click here to Skip to main content
16,004,882 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralLittle problem in Crystal Reports Pin
eshban2841-Aug-05 22:41
eshban2841-Aug-05 22:41 
GeneralRe: Little problem in Crystal Reports Pin
Rizwan Bashir2-Aug-05 4:06
Rizwan Bashir2-Aug-05 4:06 
GeneralRe: Little problem in Crystal Reports Pin
Mark062-Aug-05 12:31
Mark062-Aug-05 12:31 
GeneralCapturing Still Images Pin
sweep1231-Aug-05 22:28
sweep1231-Aug-05 22:28 
GeneralRe: Capturing Still Images Pin
Dave Kreskowiak2-Aug-05 7:22
mveDave Kreskowiak2-Aug-05 7:22 
GeneralRe: Capturing Still Images Pin
sweep1232-Aug-05 21:56
sweep1232-Aug-05 21:56 
GeneralRe: Capturing Still Images Pin
Dave Kreskowiak3-Aug-05 2:16
mveDave Kreskowiak3-Aug-05 2:16 
GeneralOLEdb updated recordset Pin
Brian_Murphy1-Aug-05 22:08
Brian_Murphy1-Aug-05 22:08 
Hi,

I have a VB.net project in which I attach to a MSAccess 2000 database. I have a listbox in which I want to populate the most recent records from a table. I have therefore put the following code into the GotFocus event of the listbox

Dim strConString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" _
& "User ID=Admin;" _
& "Data Source=C:\MCS\GolfSociety\GolfSociety.mdb"

Dim ocm As New OleDb.OleDbCommand
Dim odr As OleDb.OleDbDataReader
Dim i As Integer

' ocm = New OleDbCommand
With ocm
.Connection = New OleDbConnection(strConString)
.Connection.Open()
.CommandText = "SELECT tblmembers.memID, tblmembers.Name, tblmembers.Club_Hcap, tblmembers.Soc_Hcap FROM tblmembers ORDER BY tblmembers.Name "
odr = .ExecuteReader()
End With
cmbMembers.Items.Clear()

i = 0
While odr.Read
cmbMembers.ListItems.Add(odr("MemID"))
cmbMembers.ListItems(i).ListSubItems.Add(odr("Name"))
cmbMembers.ListItems(i).ListSubItems.Add(odr("Club_Hcap"))
cmbMembers.ListItems(i).ListSubItems.Add(odr("Soc_Hcap"))
i = i + 1
End While
odr.Close()
ocm.Connection.Close()

I would have expected that this would have executed the commandtext each time the listbox got the focus and that if I changed the table in the background that the next time I clicked the listbox I would get the updated records. This does not happen. If I click the listbox and then change the table by opening the database and editing a record, the change does not come through the next time I click the listbox.

Thanks in advance

Brian

GeneralRe: OLEdb updated recordset [EDITED] Pin
Dave Kreskowiak2-Aug-05 7:12
mveDave Kreskowiak2-Aug-05 7:12 
GeneralRe: OLEdb updated recordset [EDITED] Pin
Brian_Murphy2-Aug-05 12:05
Brian_Murphy2-Aug-05 12:05 
GeneralRe: OLEdb updated recordset [EDITED] Pin
Dave Kreskowiak3-Aug-05 2:12
mveDave Kreskowiak3-Aug-05 2:12 
GeneralRe: OLEdb updated recordset [EDITED] Pin
Brian_Murphy3-Aug-05 7:45
Brian_Murphy3-Aug-05 7:45 
GeneralRe: OLEdb updated recordset [EDITED] Pin
Dave Kreskowiak3-Aug-05 11:48
mveDave Kreskowiak3-Aug-05 11:48 
Generalhelp.. newbie.. Pin
calvin01761-Aug-05 22:07
calvin01761-Aug-05 22:07 
GeneralRe: help.. newbie.. Pin
Dave Kreskowiak2-Aug-05 7:05
mveDave Kreskowiak2-Aug-05 7:05 
GeneralInstalling Font on Client Machines Pin
tejas_chonkar1-Aug-05 20:42
tejas_chonkar1-Aug-05 20:42 
GeneralRe: Installing Font on Client Machines Pin
Rizwan Bashir2-Aug-05 0:00
Rizwan Bashir2-Aug-05 0:00 
QuestionHow I can create a project ActiveX Document with .Net? Pin
Roirin1-Aug-05 20:15
Roirin1-Aug-05 20:15 
AnswerRe: How I can create a project ActiveX Document with .Net? Pin
Dave Kreskowiak2-Aug-05 2:30
mveDave Kreskowiak2-Aug-05 2:30 
GeneralRe: How I can create a project ActiveX Document with .Net? Pin
Roirin2-Aug-05 19:25
Roirin2-Aug-05 19:25 
GeneralRe: How I can create a project ActiveX Document with .Net? Pin
Dave Kreskowiak3-Aug-05 2:10
mveDave Kreskowiak3-Aug-05 2:10 
GeneralRe: How I can create a project ActiveX Document with .Net? Pin
Roirin3-Aug-05 20:15
Roirin3-Aug-05 20:15 
GeneralRe: How I can create a project ActiveX Document with .Net? Pin
Dave Kreskowiak4-Aug-05 0:54
mveDave Kreskowiak4-Aug-05 0:54 
GeneralHelp with Listview Pin
clabrett1-Aug-05 18:10
clabrett1-Aug-05 18:10 
GeneralRe: Help with Listview Pin
Christian Graus1-Aug-05 18:34
protectorChristian Graus1-Aug-05 18: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.