Click here to Skip to main content
15,909,373 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
objDoc = gobjGeoApp.document
    'objConn = objDoc.Connections
    Dim GeoApp As GeoMedia.Application
    GeoApp = gobjGeoApp
    objDoc.Close()

    ' GeoApp.Open("C:\Dinesh\vb1\PowerPOC\PowerPOC.gws")
    GeoApp.Open("C:\GeoWorkspaces\PowerPOCfinal.gws")

    objDoc.Connections.Add("Connect1")

    With objDoc.Connections.item(1)
        '.Location = "C:\Warehouses\USSampleData.mdb"
        .Location = "C:\Warehouses\prjct_mntrng.mdb"

        .Description = "PM Data"
        .Mode = PClient.ConnectionConstants.gmcModeReadWrite
        .Type = "Access.GDatabase"
        '.Name = "Connect1"
        .Connect()

        '.BroadcastDatabaseChanges() 
    End With

    With ListBox1
        .Items.Add("Full Name = " & objDoc.Connections(1).Name)
        .Items.Add("Name = " & objDoc.Name)
        .Items.Add("Path = " & objDoc.Path)
        ' .Items.Add("ReadOnly = " & objDoc.ReadOnly)
        .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



[Edit member="Tadit"]
Added pre tags.
[/Edit]
Posted
v2
Comments
CHill60 7-Apr-14 4:34am    
And your question is?
Member 10538358 7-Apr-14 4:55am    
i am not able to display the details of the datetime picker selected dates
CHill60 7-Apr-14 19:04pm    
Only saw this by accident. If you need to respond to someone make sure you use the "Reply" link next to a post otherwise they are not notified that you are trying to contact them.
Put a break point on the line objRS = objOPipe1.OutputRecordset and run your program in debug. Examine the contents of objOPipe1.Filter - take particular care over the format of the dates. Do they match the format of the dates on your database? Have you used DateTime format on the Database? Could it be the Time section of the date that is causing the issue?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900