SQLServerName := 'PC16\SQLEXPRESS'; SQLUserID := 'AlfaViewer'; SQLPassword := 'xxx'; SQLDB := 'D2000Sql'; IF lRtc THEN BEGIN SQLConnectionString := 'Server='+SQLServerName + ';' + 'Database='+SQLDB + ';' + 'User=' + SQLUserID + ';' + 'Password=' + SQLPassword + ';' + 'Connection Timeout=20;'; SQLConnection := SQLConnection.SqlConnection(SQLConnectionString); txtStartDate := FORMAT(StartDate,8,'<Year4><Month,2><Day,2>'); txtEndDate := FORMAT(EndDate,8,'<Year4><Month,2><Day,2>'); SQLConnection.Open; SQLCommand := SQLConnection.CreateCommand(); IF SalesPoint.GET(SalesPointCode) THEN SQLCommand.CommandText := 'select * From [view_MultiTabella] ' + 'where (DataReg BETWEEN ''' + txtStartDate + ''' AND ''' + txtEndDate + ''') AND (Impianto = ''' + SalesPointCode + ''')' ELSE SQLCommand.CommandText := 'select * From [view_MultiTabella] ' + 'where (DataReg BETWEEN ''' + txtStartDate + ''' AND ''' + txtEndDate + ''')'; SQLReader := SQLCommand.ExecuteReader; END;
Comments
"This message id for C/AL programmers: The call to member System.Data.Odbc.OdbcConnection failed: Format of the initialization string does not conform to specialization starting at index 0."
I suppose that is a problem with connection string: do you know how to set it for MS Access?