Results 1 to 2 of 2

Thread: Please check this code.. Repost!

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    398

    Please check this code.. Repost!

    Guys I need some opinion, which of the two codes is best to use, or if you have a suggestion on how to do it..

    vb Code:
    1. Private gcnRIS      As ADODB.Connection
    2. Private pstConnStr  As String
    3. Private mvarErrDesc As String
    4.  
    5. Public Property Get ErrDesc() As String
    6.     ErrDesc = mvarErrDesc
    7. End Property
    8.  
    9. Public Property Let Connection(ByVal vData As ADODB.Connection)
    10.     Set gcnRIS = vData
    11. End Property
    12.  
    13. Public Function SearchSQL(sQuery As String) As ADODB.Recordset
    14.     Set SearchSQL = New ADODB.Recordset
    15.     SearchSQL.Open sQuery, gcnRIS, adOpenStatic, adLockReadOnly, adCmdText
    16. End Function
    17.  
    18. Public Function ExecuteSQL(sQuery As String) As Boolean
    19.  
    20. On Error GoTo ExecuteSQLErr
    21.    
    22.     gcnRIS.Execute sQuery, adExecuteNoRecords
    23.     ExecuteSQL = True
    24.     Exit Function
    25.    
    26. ExecuteSQLErr:
    27.     mvarErrDesc = Err.Description
    28.     ExecuteSQL = False
    29. End Function


    vb Code:
    1. Public Function SearchSQL(gcnRIS as ADODB.Connectnon, sQuery As String) As ADODB.Recordset
    2.     Set SearchSQL = New ADODB.Recordset
    3.     SearchSQL.Open sQuery, gcnRIS, adOpenStatic, adLockReadOnly, adCmdText
    4. End Function
    5.  
    6. Public Function ExecuteSQL(gcnRIS as ADODB.Connectnon, sQuery As String) As Boolean
    7.  
    8. On Error GoTo ExecuteSQLErr
    9.    
    10.     gcnRIS.Execute sQuery, adExecuteNoRecords
    11.     ExecuteSQL = True
    12.     Exit Function
    13.    
    14. ExecuteSQLErr:
    15.     mvarErrDesc = Err.Description
    16.     ExecuteSQL = False
    17. End Function

  2. #2
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Please check this code.. Repost!

    Did you post this code on the forum originally? If so please stick to the original thread instead of creating a new thread each time. If the thread was posted in the section you can request the thread moved.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

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