해결! 방금 일부 영역을 실험했는데 정확히 어떤 문제가 해결되었는지 알지 못합니다. :) 첫째, 내 테이블의 모든 데이터 형식을 Numbers에서 Text로 변경했습니다. 둘째, form2_load 및 combobox_selectedindexchanged에서 일부 코드를 수정했습니다.
하기 전에 다음
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
con.ConnectionString = "provider=microsoft.ace.oledb.12.0;data source = ..\Accounting2.accdb"
con.Open()
ComboBox1.SelectedIndex = 0
sSqlUser = "SELECT df, sdf, asdf FROM tbl_login ORDER BY df"
sSqlProduct = "SELECT cv, xcv, zxcv FROM tbl_product ORDER BY cv"
sSqlTransaction = "SELECT rt, ert, wert, qwert FROM tbl_transaction ORDER BY rt"
sSql = sSqlUser
Call FillList()
Dim dt As New DataTable
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
If ComboBox1.SelectedIndex = 0 Then
sSql = sSqlUser
ElseIf ComboBox1.SelectedIndex = 1 Then
sSql = sSqlProduct
ElseIf ComboBox1.SelectedIndex = 2 Then
sSql = sSqlTransaction
End If
End Sub
:
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
con.ConnectionString = "provider=microsoft.ace.oledb.12.0;data source = ..\Accounting2.accdb"
con.Open()
sSqlUser = "SELECT df, sdf, asdf FROM tbl_login ORDER BY df"
sSqlProduct = "SELECT cv, xcv, zxcv FROM tbl_product ORDER BY cv"
sSqlTransaction = "SELECT rt, ert, wert, qwert FROM tbl_transaction ORDER BY rt"
ComboBox1.SelectedIndex = 0
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
If ComboBox1.SelectedIndex = 0 Then
sSql = sSqlUser
ElseIf ComboBox1.SelectedIndex = 1 Then
sSql = sSqlProduct
ElseIf ComboBox1.SelectedIndex = 2 Then
sSql = sSqlTransaction
End If
Call FillList()
Dim dt As New DataTable
End Sub
내가있어 내 질문에 대한 대답. 도움을 주신 Raj에게 감사드립니다. 정말 감사. :) 나중에 내 코드를 게시 할 것입니다. –