Results 1 to 3 of 3

Thread: Datareport Dumie

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2005
    Location
    Greece
    Posts
    61

    Datareport Dumie

    Hi all
    I have this code
    VB Code:
    1. Private Sub Form_Load()
    2. ' **** Create Connection and Recordset Objects ****
    3. Dim cnConn As ADODB.Connection
    4. Dim rs As ADODB.Recordset
    5. Dim strsql As String
    6.  
    7. ' **** Instantiate the new objects ****
    8. Set cnConn = New ADODB.Connection
    9. Set rs = New ADODB.Recordset
    10.  
    11. ' **** Set up connection String    ****
    12. With cnConn
    13.     .Provider = "SQLOLEDB.1"
    14.     .Properties("Data Source").Value = "www"
    15.     .Properties("User ID").Value = "clroot"
    16.     .Properties("Password").Value = "clroot"
    17.     .Properties("Initial Catalog").Value = "iosif"
    18.     .CursorLocation = adUseClient
    19.     .ConnectionTimeout = 0
    20.     .Open
    21. End With
    22.  
    23. ' **** String to pass to the connection to get records back ****
    24. strsql = "select * from salesman"
    25.  
    26. ' **** Open Records for readonly ****
    27. rs.Open strsql, cnConn, adOpenStatic, adLockReadOnly

    How I can pass values from table salesman into a datareport1?

    thank you






    Edit: Added [vbcode][/vbcode] tags for more clarity. - Hack
    Last edited by Hack; Nov 14th, 2005 at 01:22 PM.

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