Results 1 to 2 of 2

Thread: Anyone know how to use Data Controls?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Posts
    68
    I have two adodc controls on the form am I want to extract some data from one record and reference that against another data source and display the answer.

    The code is as follows



    Function Search_PN()
    Dim strSQL As String
    Dim MAXData As ADODB.Recordset
    Dim maxfield As ADODB.field


    Dim strSQLstatus As String
    Dim StatusCode As ADODB.Recordset
    Dim statusfield As ADODB.field


    Dim Count As Integer
    Count = -1
    'ProductData.Mav_DB.Open



    strSQL = "SELECT uzdload.dload_item, uzdload.dload_descext, uzdload.dload_drawiss, uzdload.dload_striss, uzdload.dload_status, uzdload.dload_stitem, uzdload.dload_stiss" & " FROM uzdload" & " WHERE uzdload.dload_item = " & Chr(39) & frmSearch.DataComboPN.Text & Chr(39) & Chr(59)

    'Identifies which ADO connection is being used for SQL.
    frmSearch.maxdatasource.RecordSource = strSQL
    Set MAXData = frmSearch.maxdatasource.Recordset

    For Each maxfield In MAXData.Fields
    Count = Count + 1

    If maxfield.Name = "dload_status" Then
    strSQLstatus = "SELECT mmiss.mmiss_code" & " FROM mmiss" & "WHERE mmiss.mmiss_code =" & Chr(39) & maxfield.Value & Chr(59)
    frmSearch.mmissdatasource.RecordSource = strSQLstatus
    Set StatusCode = frmSearch.mmissdatasource.Recordset
    With StatusCode.Fields
    frmView.MAXData(Count) = statusfield.Value
    End With
    Else
    frmView.MAXData(Count) = maxfield.Value
    End If
    Next

    MAXData.Close
    Set MAXData = Nothing

    End Function

  2. #2
    Lively Member
    Join Date
    Aug 2000
    Location
    Posts
    105
    Hello ,
    Well i recently started working with database in vb6
    so i don't know the answer. but i recently downloaded a book of 730 pages in vb database - excellent book!
    in pdf file ,if you want this file reply me and i'll send
    you.
    ([email protected])

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width