crystal reports data source in design sql in runtime mdb? RRS feed

  • Question

  • hi everyone,

    i have a crystal reports designed with datasource from ms sql 2008 server. But in runtime there is an option to use mdb as datasource. Now my question is is there an opportunity to use mdb as datasource to connect  this report file?   tables names and columns names are identically in mdn and sql db.

    here a picture from designmode 
    connection properties in design mode

    and here a line of code i use in runtime for mdb connection but it's not working .

     TableLogOnInfo logOnInfo;
                ConnectionInfo connectionInfo=new ConnectionInfo();
       connectionInfo.Type = ConnectionInfoType.CRQE;
                    connectionInfo.ServerName = connectionInfo.DatabaseName = Snelfactuur.dbProfile.AbsolutePathMDB;
                    connectionInfo.UserID = null;
                    connectionInfo.Password = "";
                   // connectionInfo.AllowCustomConnection = true;
                    connectionInfo.IntegratedSecurity = false;
     foreach (Table table in cryRpt.Database.Tables)
      table.LogOnInfo.ConnectionInfo = connectionInfo;
      logOnInfo = table.LogOnInfo;
      logOnInfo.TableName = table.Name;
                        table.LogOnInfo.ConnectionInfo.LogonProperties.Add(new NameValuePair2("Database Name", connectionInfo.ServerName));
                        table.LogOnInfo.ConnectionInfo.LogonProperties.Add(new NameValuePair2("Database Type", "Access"));

    Any suggestions are welcome 

    thanks by advance


    • Moved by Jason Dot Wang Friday, April 19, 2013 2:31 AM This thread is about ASP.NET
    Thursday, April 18, 2013 8:05 AM


All replies