Results 1 to 11 of 11

Thread: VB6 + :

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    . worm4's Avatar
    Join Date: Jul:2005
    Location: Varna
    Posts: 20,295

    VB6 + :

    : .

    "adcRecordValue.Open" . , ?


    Code:
    Sub RecordValue()
    Dim adcRecordValue As New ADODB.Connection
    adcRecordValue.ConnectionString = strConectionString
    adcRecordValue.CommandTimeout = 30
    ActiveConnection = adcRecordValue
    adcRecordValue.Open
    If intErr = 0 Then
    adcRecordValue.Execute "insert into tblhistory (flddate_and_time, fldDevice, fldRegister, fldValue) values ('" _
    & DateToString(Date) & " " & TimeToString(Time) & "', " & intDeviceAdressLengthValue(0, intCurentValue) & ", " & _
    intDeviceAdressLengthValue(1, intCurentValue) & ", " & Replace(Val("&H" & strRecivedData) / 10 ^ intDeviceAdressLengthValue(3, intCurentValue), "'", ".") & " )", , 1
    adcRecordValue.Execute "insert into tblView (flddate_and_time, fldDevice, fldRegister, fldValue) values ('" & DateToString(Date) & " " & TimeToString(Time) & _
    "', " & intDeviceAdressLengthValue(0, intCurentValue) & ", " & intDeviceAdressLengthValue(1, intCurentValue) & ", " & Replace(Val("&H" & strRecivedData) / 10 ^ intDeviceAdressLengthValue(3, intCurentValue), "'", ".") & " )", , 1
    Else
    adcRecordValue.Execute "insert into tblerror (flddate_and_time, fldDevice, fldRegister, flderror, fldmessage) values ('" & DateToString(Date) & " " & TimeToString(Time) & "', " & intDeviceAdressLengthValue(0, intCurentValue) & ", " & intDeviceAdressLengthValue(1, intCurentValue) & ", " & intErr & ", '" & strModbusReciveMessage & "')", , 1
    Call ErrorLoging(DateToString(Date) & Chr(9) & TimeToString(Time) & Chr(9) & intDeviceAdressLengthValue(0, intCurentValue) & Chr(9) & intDeviceAdressLengthValue(1, intCurentValue) & Chr(9) & intErr & " )")
    
    End If
    adcRecordValue.Close
    End Sub
    "Arbeit macht frei" -
    - . , :..,,--?!
    OgiDogi: , , ..,

  2. #2
    ! Rostislao's Avatar
    Join Date: Feb:2005
    Location: Bulgaria
    Posts: 822
    Quote Originally Posted by worm4
    : .

    "adcRecordValue.Open" . , ?


    Code:
    Sub RecordValue()
    Dim adcRecordValue As New ADODB.Connection
    adcRecordValue.ConnectionString = strConectionString
    adcRecordValue.CommandTimeout = 30
    ActiveConnection = adcRecordValue
    adcRecordValue.Open
    If intErr = 0 Then
    adcRecordValue.Execute "insert into tblhistory (flddate_and_time, fldDevice, fldRegister, fldValue) values ('" _
    & DateToString(Date) & " " & TimeToString(Time) & "', " & intDeviceAdressLengthValue(0, intCurentValue) & ", " & _
    intDeviceAdressLengthValue(1, intCurentValue) & ", " & Replace(Val("&H" & strRecivedData) / 10 ^ intDeviceAdressLengthValue(3, intCurentValue), "'", ".") & " )", , 1
    adcRecordValue.Execute "insert into tblView (flddate_and_time, fldDevice, fldRegister, fldValue) values ('" & DateToString(Date) & " " & TimeToString(Time) & _
    "', " & intDeviceAdressLengthValue(0, intCurentValue) & ", " & intDeviceAdressLengthValue(1, intCurentValue) & ", " & Replace(Val("&H" & strRecivedData) / 10 ^ intDeviceAdressLengthValue(3, intCurentValue), "'", ".") & " )", , 1
    Else
    adcRecordValue.Execute "insert into tblerror (flddate_and_time, fldDevice, fldRegister, flderror, fldmessage) values ('" & DateToString(Date) & " " & TimeToString(Time) & "', " & intDeviceAdressLengthValue(0, intCurentValue) & ", " & intDeviceAdressLengthValue(1, intCurentValue) & ", " & intErr & ", '" & strModbusReciveMessage & "')", , 1
    Call ErrorLoging(DateToString(Date) & Chr(9) & TimeToString(Time) & Chr(9) & intDeviceAdressLengthValue(0, intCurentValue) & Chr(9) & intDeviceAdressLengthValue(1, intCurentValue) & Chr(9) & intErr & " )")
    
    End If
    adcRecordValue.Close
    End Sub
    " set adcRecordValue = nothing"
    ... NEW set .... = nothing.
    " ? ..."

  3. #3
    . worm4's Avatar
    Join Date: Jul:2005
    Location: Varna
    Posts: 20,295


    ....

    .....
    "Arbeit macht frei" -
    - . , :..,,--?!
    OgiDogi: , , ..,

  4. #4
    ! Rostislao's Avatar
    Join Date: Feb:2005
    Location: Bulgaria
    Posts: 822
    VB6 , . ... , ImeNaProcedura(bla1,bla2) ,
    " ? ..."

  5. #5
    XaMaB's Avatar
    Join Date: Nov:2001
    Location:
    Posts: 20,387
    :
    ;
    : XaMaB; . 0.42

    In God we Trust (all others must submit a X.509 certificate). , ()

  6. #6
    Registered User
    Join Date: Jul:2001
    Location: Redmond, USA
    Posts: 1,699
    :
    ActiveConnection = adcRecordValue

    ActiveConnection, ?

    memory leek-a intDeviceAdressLengthValue(...) .
    Quote Originally Posted by Rostislao
    " set adcRecordValue = nothing"
    ... NEW set .... = nothing.
    Basic-a .
    Soltek 75FRN2-RL bred "B" 1700+ : 1466@2300(11.5x200) 1.85V 512 MB DDR333 TwinMOS: 11-3-3-2@2.8V Leadtek Geforce4Ti 4200 128 MB : 300/600 80GB Seagate 7200.7 CDROM 48x BenQ Enermax EG365P-VE/FCA 350W Creative DT2200 5.1 Middle Tower Water Cooling

  7. #7
    ! Rostislao's Avatar
    Join Date: Feb:2005
    Location: Bulgaria
    Posts: 822
    ... . , . 1 ADODB , , . new set... = nothing, , .. nothing

    /
    ...
    /
    " ? ..."

  8. #8
    Registered User
    Join Date: Jul:2001
    Location: Redmond, USA
    Posts: 1,699
    , VB6 ADO, SET conn = Nothing - , ADO Connection-. memory management-a ... Set X = Nothing , .
    , ...
    Soltek 75FRN2-RL bred "B" 1700+ : 1466@2300(11.5x200) 1.85V 512 MB DDR333 TwinMOS: 11-3-3-2@2.8V Leadtek Geforce4Ti 4200 128 MB : 300/600 80GB Seagate 7200.7 CDROM 48x BenQ Enermax EG365P-VE/FCA 350W Creative DT2200 5.1 Middle Tower Water Cooling

  9. #9
    ! Rostislao's Avatar
    Join Date: Feb:2005
    Location: Bulgaria
    Posts: 822


    , NOTHING , new , ...

    :Worm4, MSSQL Server, , ( ) .
    Last edited by Rostislao; 3rd May 2006 at 08:57.
    " ? ..."

Posting Permissions

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

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |