Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.visual.basic    |    MS Visual Basic discussions, NOT dot-net    |    10,840 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 10,281 of 10,840    |
|    JP to Geoff    |
|    Re: ADO Data Control in VB 6.0    |
|    31 Oct 06 16:37:33    |
      From: jprobb@seniortrans.com              Geoff...              The help file shows that the ADO Recordsource can be an SQL Statement.       That's what I've tried to execute. In the example I gave... I ran a DAO       recordset to see if the SQL was correct. It was. The actual code is:              Private Sub GetPositions(lgDeptID As Long, lgLocID As Long)        Dim sPositSQL As String               sPositSQL = "SELECT [Position Table].LocationID, [Position       Table].DepartID, "        sPositSQL = sPositSQL & "[Position Table].Position "        sPositSQL = sPositSQL & "From [Position Table] "        sPositSQL = sPositSQL & "Where ((([Position Table].LocationID) = " &       lgLocID & ") And "        sPositSQL = sPositSQL & "(([Position Table].DepartID) = " & lgDeptID &       ")) "        sPositSQL = sPositSQL & "ORDER BY [Position Table].Position; "               With datPosit        .ConnectionString = stConn        .RecordSource = sPositSQL        .Refresh        End With              End Sub              As you can see, there is no DAO here. I'm just trying to put the       "recordsource" (SQL) as the recordset to be used in the control.              I need a grid and am using the DataGrid which requires the ADODC. On my       tool bar, when I run my mouse over the other data control, it says "Data"       and that will not display as an appropriate datasource for the DataGrid.              I'm not using DAO for any ADODC control on any form... I'm using SQL       Statements as the Recordsource.              JP                     "Geoff" |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca