Q
QT
Dear Sirs,
I am using following codes to have a list box in form. When I run that form
as a start up object, I have no problem.
I have a MDI parent form which has user login feature. To confirm user
password MDI parent form is connecting users.mdb. When I run my project with
MDI Parent form as a start up object, I can not same result with list box
which is on the different form page as MDI Child Form. List box shows to me;
System.Data.Row.View for each record.
Where is my error, any idea.
Chil form codes;
'OleDbSelectCommand1
'
Me.OleDbSelectCommand1.CommandText = "SELECT Explanation, Main_Category FROM
AuditMainCategory"
Me.OleDbSelectCommand1.Connection = Me.OleDbConnection1
'OleDbConnection1
'
OleDbConnection1.ConnectionString = "Jet OLEDB:Global Partial Bulk Ops=2;Jet
OLEDB:Registry Path=;Jet OLEDBatabase L" & _
"ocking Mode=1;Jet OLEDBatabase Password=;Data Source=" & CurDir() &
"\Data\Support.mdb" & ";Password=;Jet OLEDB:Engine Type=5;Jet OLEDB:Global"
& _
" Bulk Transactions=1;Provider=""Microsoft.Jet.OLEDB.4.0"";Jet OLEDB:System
databas" & _
"e=;Jet OLEDB:SFP=False;Extended Properties=;Mode=Share Deny None;Jet
OLEDB:New D" & _
"atabase Password=;Jet OLEDB:Create System Database=False;Jet OLEDBon't
Copy Lo" & _
"cale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;User
ID=Adm" & _
"in;Jet OLEDB:Encrypt Database=False"
'OleDbDataAdapter1
'
Me.OleDbDataAdapter1.SelectCommand = Me.OleDbSelectCommand1
Me.OleDbDataAdapter1.TableMappings.AddRange(New
System.Data.Common.DataTableMapping() {New
System.Data.Common.DataTableMapping("Table", "AuditMainCategory", New
System.Data.Common.DataColumnMapping() {New
System.Data.Common.DataColumnMapping("Explanation", "Explanation"), New
System.Data.Common.DataColumnMapping("Main_Category", "Main_Category")})})
'
Dim AuditMainCategory_ds As DataSet = New DataSet
Me.OleDbDataAdapter1.Fill(AuditMainCategory_ds, "AuditMainCategory")
' Attach dataset's DefaultView to the datagrid control
Dim AuditMainCategory_dv As DataView =
AuditMainCategory_ds.Tables("AuditMainCategory").DefaultView
Me.ListBox1.DataSource = AuditMainCategory_dv
Me.ListBox1.DisplayMember = "Main_Category"
I am using following codes to have a list box in form. When I run that form
as a start up object, I have no problem.
I have a MDI parent form which has user login feature. To confirm user
password MDI parent form is connecting users.mdb. When I run my project with
MDI Parent form as a start up object, I can not same result with list box
which is on the different form page as MDI Child Form. List box shows to me;
System.Data.Row.View for each record.
Where is my error, any idea.
Chil form codes;
'OleDbSelectCommand1
'
Me.OleDbSelectCommand1.CommandText = "SELECT Explanation, Main_Category FROM
AuditMainCategory"
Me.OleDbSelectCommand1.Connection = Me.OleDbConnection1
'OleDbConnection1
'
OleDbConnection1.ConnectionString = "Jet OLEDB:Global Partial Bulk Ops=2;Jet
OLEDB:Registry Path=;Jet OLEDBatabase L" & _
"ocking Mode=1;Jet OLEDBatabase Password=;Data Source=" & CurDir() &
"\Data\Support.mdb" & ";Password=;Jet OLEDB:Engine Type=5;Jet OLEDB:Global"
& _
" Bulk Transactions=1;Provider=""Microsoft.Jet.OLEDB.4.0"";Jet OLEDB:System
databas" & _
"e=;Jet OLEDB:SFP=False;Extended Properties=;Mode=Share Deny None;Jet
OLEDB:New D" & _
"atabase Password=;Jet OLEDB:Create System Database=False;Jet OLEDBon't
Copy Lo" & _
"cale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;User
ID=Adm" & _
"in;Jet OLEDB:Encrypt Database=False"
'OleDbDataAdapter1
'
Me.OleDbDataAdapter1.SelectCommand = Me.OleDbSelectCommand1
Me.OleDbDataAdapter1.TableMappings.AddRange(New
System.Data.Common.DataTableMapping() {New
System.Data.Common.DataTableMapping("Table", "AuditMainCategory", New
System.Data.Common.DataColumnMapping() {New
System.Data.Common.DataColumnMapping("Explanation", "Explanation"), New
System.Data.Common.DataColumnMapping("Main_Category", "Main_Category")})})
'
Dim AuditMainCategory_ds As DataSet = New DataSet
Me.OleDbDataAdapter1.Fill(AuditMainCategory_ds, "AuditMainCategory")
' Attach dataset's DefaultView to the datagrid control
Dim AuditMainCategory_dv As DataView =
AuditMainCategory_ds.Tables("AuditMainCategory").DefaultView
Me.ListBox1.DataSource = AuditMainCategory_dv
Me.ListBox1.DisplayMember = "Main_Category"