Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 17th, 2006, 03:45 AM
Registered User
 
Join Date: May 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to declovey
Default error : [server has not yet been opened] - HELP ME

Hi Everybody....

could you please help me to see the code below???

Code:
Dim appl As New CRAXDRT.Application
Dim report As New CRAXDRT.report
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset

Private Sub Form_Load()
Set con = New ADODB.Connection
con.Open "PROVIDER=SQLOLEDB.1;SERVER=DEBBIE;INITIAL CATALOG=WIS;USER id=sa;PASSWORD=sql ;PROMPT=NOPROMPT"

Set rs = New ADODB.Recordset
sql = "select mat_cd, matname, loccode, qty, qty_available " & _
"from m_rawmat inner join wi_matxloc on mat_cd = matcode"
rs.Open sql, con, adOpenForwardOnly, adLockReadOnly
rs.Filter = "mat_cd = '" & Form2.Text1.Text & "'"

Set report = appl.OpenReport(App.Path & "\report\inventory.rpt")
report.DiscardSavedData
report.Database.Tables(1).SetDataSource rs, 3
CRViewer1.ReportSource = report
CRViewer1.ViewReport
End Sub
I'm so frustated about this.....
It always prompt me this errror msg [Server has not yet been opened]
I dont understand where the problem lies ....

Please kindly help me to correct my code...
I'm in urgent...

Thanks in advance ....
__________________
Best Regards,
Debbie
 
Old July 17th, 2006, 03:48 AM
Registered User
 
Join Date: May 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to declovey
Default

I'm sorry that I forget to tell you that I was trying to create a crytal report 8.5 from VB 6.0.....

^^

 
Old July 18th, 2006, 02:00 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Which line throws the error?
 
Old February 10th, 2007, 05:02 AM
Registered User
 
Join Date: Feb 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi
before opening report you have to login to sql server



report.Database.Tables(index).SetLogOnInfo ServerName, [DatabaseName,ViewName], [SQLuserid], [Sql Password]

use above command after discarding saved data in reports
report.DiscardSavedData

Regards PRashant






Similar Threads
Thread Thread Starter Forum Replies Last Post
Server has not yet been opened Fernando Cisternas Crystal Reports 0 January 13th, 2006 05:12 PM
how to solve "server has not yet been opened" Err jigneshsoni Access VBA 0 June 6th, 2005 10:47 PM
how to solve "server has not yet been opened" Err jigneshsoni Crystal Reports 0 June 6th, 2005 10:43 PM
Server not yet opened sathishraj Crystal Reports 1 October 15th, 2003 08:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.