dcsimg
Results 1 to 8 of 8

Thread: what does this code do? Can you explain? Can you give me manual in internet?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2019
    Posts
    24

    what does this code do? Can you explain? Can you give me manual in internet?

    what does this code do? Can you explain? Can you give me manual in internet?

    Private Sub Вес_Click()
    Dim rs As ADODB.Recordset, Фирма1 As String
    Фирма1 = Nz(DLookup("Фирма1", "Итого"))
    Set rs = New ADODB.Recordset
    rs.Open "select nm_tabl From tb_tabl Where vkl = 3 order By nm_tabl", CurrentProject.Connection, adOpenDynamic, adLockOptimistic, adCmdTableDirect
    With rs
    Do While Not .EOF
    SysCmd acSysCmdSetStatus, "Обработка таблицы: " & !nm_tabl
    CurrentDb.QueryDefs("Вес").SQL = "UPDATE " & !nm_tabl & " INNER JOIN Итого ON (" & !nm_tabl & ".Поле1 = Итого.Артикул) AND (" & !nm_tabl & ".Поле2 = Итого.Фирма) SET Итого.Вес = [" & !nm_tabl & "].[Поле3]"
    CurrentDb.Execute "Вес"
    .MoveNext
    Loop
    If Фирма1 <> "" Then
    .MoveFirst
    Do While Not .EOF
    SysCmd acSysCmdSetStatus, "Обработка таблицы: " & !nm_tabl
    CurrentDb.QueryDefs("Вес").SQL = "UPDATE " & !nm_tabl & " INNER JOIN Итого ON (" & !nm_tabl & ".Поле1 = Итого.Артикул) AND (" & !nm_tabl & ".Поле2 = Итого.Фирма1) SET Итого.Вес = [" & !nm_tabl & "].[Поле3]"
    CurrentDb.Execute "Вес"
    .MoveNext
    Loop
    End If
    End With
    rs.Close
    MsgBox ("Вес сформирован")

    End Sub

  2. #2
    Fanatic Member
    Join Date
    Feb 2003
    Posts
    722

    Re: what does this code do? Can you explain? Can you give me manual in internet?

    As far as I can tell the code you posted uses Microsoft ADO to access a database and execute a query. Have a look at this thread: http://www.vbforums.com/showthread.p...for-Classic-VB. And please use code tags when posting code. Also where did you find it?

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2019
    Posts
    24

    Re: what does this code do? Can you explain? Can you give me manual in internet?

    how can i in visual basic console track date that is being inserted in table using compiler?

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jun 2019
    Posts
    24

    Re: what does this code do? Can you explain? Can you give me manual in internet?

    how to set up Debug.Print to watch what date take from what tables?

  5. #5
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    7,054

    Re: what does this code do? Can you explain? Can you give me manual in internet?

    What do you mean 'track date'? Are you trying to see if someone on a LAN or WAN is adding/changing/deleting records in a DB table? Or are you just interested in adding date/time information to your DB table(s) in your local project?

    As far as your Debug question---do a SELECT query on your table(s) and debug.print the date field(s).

    I am kind of thinking you are wanting a 'watch dog' type of thing, where you want to know if someone is accessing your tables. Is that your end game?

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Jun 2019
    Posts
    24

    Re: what does this code do? Can you explain? Can you give me manual in internet?

    how do i make output from these lines below using Debug.Print for !nm_tabl variable? we need also values Total.weght , & !nm_tabl & ".Поле2 , Total.Артикул in immdiate windows for ever cicle of the program.
    We need to output values of all variable in this code line below for debug!
    Do While Not .EOF
    SysCmd acSysCmdSetStatus, "Обработка таблицы: " & !nm_tabl
    CurrentDb.QueryDefs("Вес").SQL = "UPDATE " & !nm_tabl & " INNER JOIN Итого ON (" & !nm_tabl & ".Поле1 = Total.Артикул) AND (" & !nm_tabl & ".Поле2 = Total.Фирма) SET Total.weght = [" & !nm_tabl & "].[Поле3]"
    CurrentDb.Execute "Вес"

  7. #7
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    3,553

    Re: what does this code do? Can you explain? Can you give me manual in internet?

    Please keep all your questions about the same topic in a single thread.
    Now you have 3 threads with the same question...

  8. #8
    PowerPoster
    Join Date
    Feb 2006
    Posts
    20,416

    Re: what does this code do? Can you explain? Can you give me manual in internet?

    And all about MS Access VBA. That code won't work in VB6. WRONG FORUM.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width