Results 1 to 6 of 6

Thread: CR Logging into SQL Server **Resolved**

  1. #1

    Thread Starter
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    CR Logging into SQL Server **Resolved**

    I created a simple CR 8.5 report for my application. When I was setting up the report I typed in the user name and password for a database in SQL Server. But when I run the program I receive messages that tell me that I am not logged into the server. Here is the code from form1:

    VB Code:
    1. Dim Report As New CrystalReport1
    2.  
    3. Private Sub Form_Load()
    4. Screen.MousePointer = vbHourglass
    5. CRViewer1.ReportSource = Report
    6. CRViewer1.ViewReport
    7. Screen.MousePointer = vbDefault
    8.  
    9. End Sub
    10.  
    11. Private Sub Form_Resize()
    12. CRViewer1.Top = 0
    13. CRViewer1.Left = 0
    14. CRViewer1.Height = ScaleHeight
    15. CRViewer1.Width = ScaleWidth
    16.  
    17. End Sub

    What do need to add to my code inorder to log into the server so that I can display my report?



    Thanks
    Last edited by Mark Gambo; Feb 4th, 2004 at 07:27 PM.
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


  2. #2

    Thread Starter
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965
    Bump
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


  3. #3
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    Doesn't the CrystalReport1 object contain Username and Password properties?

  4. #4

    Thread Starter
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965
    Bruce,
    Thanks for the reply, but I was not able to find a UserName nor a Password Properties. What would the format of the property be?
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


  5. #5
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    What is CrystalReport1? Is it not the Crystal OCX? What about a Connection property.

  6. #6

    Thread Starter
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965
    Bruce,

    I figured it out and here it is:
    VB Code:
    1. Report.Database.Tables(1).SetLogOnInfo <Server Name>, <Database Name>, <User Name>, <Password>


    Thanks for your help
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


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