General information
Category:
Database DAO/RDO/ODBC/ADO
Title:
Error:Server has not yet been opened.
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only