2014-10-31 4 views
0

이것은 구문을 모른다는 부분입니다. 내 양식에서 데이터베이스 의 데이터를 자동으로로드하려면 b_date를 사용하지만 월에 일치하는 레코드 만 표시하면됩니다. 올해를 사용하지 않는 날짜 이 프로그램은 사용자가 날짜와 월을 지정 곳에날짜에 따른 올바른 구문

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 
     'TODO: This line of code loads data into the 'Bene_dbDataSet.bene_records' table. You can move, or remove it, as needed. 
     Me.Bene_recordsTableAdapter.Fill(Me.Bene_dbDataSet.bene_records) 

     con = New OleDb.OleDbConnection 
     dbProvider = "Provider=Microsoft.Jet.OLEDB.4.0;" 
     dbSource = "Data Source = C:\Users\RedemptorisMater\Desktop\S\K\WindowsApplication1\WindowsApplication1\bene_db.mdb" 

     con.ConnectionString = dbProvider & dbSource 

     If Not con.State = ConnectionState.Open Then 
      con.Open() 
     End If 

     Dim da As OleDb.OleDbDataAdapter 
     Dim Sql As String 


     Sql = "SELECT * FROM bene_records" 
     da = New OleDb.OleDbDataAdapter(Sql, con) 

     Dim dt As New DataTable 
     da.Fill(dt) 

     con.Close() 

     My.Computer.Audio.Play("C:\Users\R\Desktop\S\Kenton\WindowsApplication1\WindowsApplication1\bday1.wav", 
     AudioPlayMode.Background) 

    End Sub 

답변

0

당신은 너무 특정 D를 얻기 위해, 언급하지 않는 생일 알림처럼/M :

SELECT bene_records.*, Day([b_date]) AS MyDay, Month([b_date]) AS MyMonth 
FROM bene_records 
WHERE (((Day([b_date]))=1) AND ((Month([b_date]))=11)); 

수 있습니다. 자신의 기준으로 하드 코드 된 날짜/월을 레이스하십시오.