Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error:Server has not yet been opened.
Message
From
12/02/2004 21:15:35
 
 
To
All
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Title:
Error:Server has not yet been opened.
Miscellaneous
Thread ID:
00876950
Message ID:
00876950
Views:
59
This is VB6.0 & Crystal Report 8.0 problem

I want to add ADO data sources to a report,but if program run to "m_report.database.addadocommand m_connection,m_command" is Error

Error:"Server has not yet been opened." what is wrong???

This is my code

Dim m_Connection As ADODB.Connection
Dim m_Rs As ADODB.Recordset
Set m_Connection = New ADODB.Connection
Set m_Rs = New ADODB.Recordset
m_Connection.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=northwind;Data Source=liuxiaoling;Password=;"
m_Connection.Open
m_strSql = "select orderid,customerid,employeeid from orders"
Set m_Command = New ADODB.Command
Set m_Command.ActiveConnection = m_Connection
m_Command.CommandText = m_strSql
m_Command.CommandType = adCmdText

m_Report.Database.AddADOCommand m_Connection, m_Command


Help me,Thanks!
Reply
Map
View

Click here to load this message in the networking platform