Creating Access file in ASP.NET RRS feed

  • Question

  • Folks,

    I need your help. I want to query a sql database and output an Access file in How can i do that? Please advice.

    Monday, September 10, 2007 4:29 PM


All replies

  • The following MS KB article demonstrates how to create an Access database:

    How to create a Microsoft Access database by using ADOX and Visual Basic .NET


    The next step will depend upon whether you want to export the data directly from SQL Server using SQL or if you have to export the data row by row.

    Monday, September 10, 2007 10:05 PM
  • I was thinking of pulling the data from SQL to a dataset, using normal ADO.NET, and then convert that dataset to an access file.

    Can that be done?

    Tuesday, September 11, 2007 4:30 PM
  • It isn't possible to convert the DataSet directly to an Access database file. You have to create the Access database first and then insert the data.


    It is possible to insert the data directly using SQL, but the Access database file must exist first. For example, after creating a connection to the Access database you can import data from an Orders table in SQL Server and export that to an Access table:


    SELECT * INTO Orders FROM [Orders] IN '' [ODBC;Driver={SQL Server};Server=(local);Database=Northwind;Trusted_Connection=yes];





    Tuesday, September 11, 2007 5:29 PM