Form Based on one record

Using VB Express

How do I set up a child form so that it only displays one record out of a table of thousands

I have used the Filter property like this:

        Dim child As New frmSite
        child.MdiParent = Me
        child.QrySiteDataConnector.Filter = "Site_ID='100'"
        child.Show()

QrySiteDataConnector points to an AccessXP MDB query that in turn is linked to table on an ancient SQL 6.5 backend.

The form loads slowly as if it is reading the enter table pointed to by the QrySiteDataConnector.  A filtered query on the MDB is very fast.

A navigator on the form indicates there is only one record.

Can I setup a DC's record source dynmically   Perhaps creating an ADO recordset and using that as the record source for the form

I will eventually have SQL Server 2000 and full VS 2005 - what method would be used from those platforms

Any books out yet on how to develop database forms under VB Express

TIA


Answer this question

Form Based on one record

  • Pierre bzh


    Not sure what you mean by can you setup a "DC's" record source dynamically but it was designed to allow the data source to be changed at runtime.

    The design will depend on the data.  Assuming it's dynamic and can't be cached, you'll probably want to create a SP that queries the data using the "Site_ID" as a parameter.  You'd use ADO.NET and the data designers to set this up.

  • Form Based on one record