我已經創建了兩個日期時間選擇器的格式,並希望訪問從日期時間選擇器中選擇兩個特定日期之間存儲在Access數據庫中的數據訪問的數據庫中的數據。如何使用日期時間選擇器值使用VB.NET
可能有人請幫助如何處理該按鈕
objDoc = gobjGeoApp.document
Dim GeoApp As GeoMedia.Application
GeoApp = gobjGeoApp
objDoc.Close()
GeoApp.Open("C:\GeoWorkspaces\PowerPOCfinal.gws")
objDoc.Connections.Add("Connect1")
With objDoc.Connections.item(1)
.Location = "C:\Warehouses\prjct_mntrng.mdb"
.Description = "PM Data"
.Mode = PClient.ConnectionConstants.gmcModeReadWrite
.Type = "Access.GDatabase"
.Connect()
End With
With ListBox1
.Items.Add("Full Name = " & objDoc.Connections(1).Name)
.Items.Add("Name = " & objDoc.Name)
.Items.Add("Path = " & objDoc.Path)
.Items.Add("Storage = " & objDoc.Storage)
End With
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
' Create and display recordset of Actual Start
objConnect = objDoc.Connections.item(1)
objConnect.CreateOriginatingPipe(objOPipe1)
With objOPipe1
.GeometryFieldName = "Geometry"
.Table = "Electric_Cables"
.Filter = "((Electric_Cables.Actual_Start)<=" + DateTimePicker1.Value.Date() + " And (Electric_Cables.Actual_Start)<=" + DateTimePicker2.Value.Date() + ")"
objRS = objOPipe1.OutputRecordset
objRS.MoveLast()
objRS.MoveFirst()
MsgBox(objOPipe1.OutputRecordset.RecordCount)
End With
End Sub
你知道如何從vb.net連接到數據庫? – Baby