Information générale
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Titre:
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!
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement