Any body know how to set connection and pass parameter for Data Environment and DataReport in VB 6 ?<br><br>1. My system work OK if I connect at design time ( by fill in correct server details at dbmaster Data Link Properties Connection tab) and disable the code inside "begin connection code" and "end connection code"<br><br>2. If I leave dbmaster Data Link Properties Connection tab blank. and enable the code inside "begin connection code" and "end connection code"<br> I received run-time error '-2147417848(80010108)' method 'Customer Statement_Grouping' of object '_deMaster' failed. The error debug points at code after *errLEVEL.<br><br>3. I found out from MSDN site that the run time error code is a bug of VB 6 but they don't relate to DataReport object.<br><br>Any INPUT?<br><br>my code:<br><br> 'begin connection code<br> deMaster.dbmaster.ConnectionString = "Provider=SQLOLEDB.1;Password=01;Persist Security Info=true;User ID=01;Initial Catalog=dbmasterCat;Data Source=NTSERVER"<br> If deMaster.dbmaster.State = adStateOpen then<br> deMaster.dbmaster.Close<br> End If<br> deMaster.dbmaster.Open<br> 'end connection code<br><br> With deMaster<br> If .rsCustomerStatement_Grouping.State = adStateOpen then<br> .rsCustomerStatement_Grouping.Close<br> End If<br> '*errLEVEL<br> .CustomerStatement_Grouping txtICNo, Format(dtpDateFr & " 00:00:00", "yyyy-mm-dd hh:mm:ss"
, Format(dtpDateTo & " 23:59:59", "yyyy-mm-dd hh:mm:ss"
, C_NEWACCT, C_SALE<br> <br> End With<br> set rptCustStmt.DataSource = deMaster<br> rptCustStmt.Show<br>