Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error:Server has not yet been opened.
Message
De
12/02/2004 21:15:35
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Titre:
Error:Server has not yet been opened.
Divers
Thread ID:
00876950
Message ID:
00876950
Vues:
58
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
Fil
Voir

Click here to load this message in the networking platform