473,325 Members | 2,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

How to copy mdb access and convert into excel file in vb.net?

Expand|Select|Wrap|Line Numbers
  1. catNewDB.Create("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" + newpath + "\DDCOS.mdb")
  2.             Dim cmdd As New OleDb.OleDbCommand("CREATE TABLE DDCOS( " & _
  3.                "RecNum int identity," & "ZipFile NVarchar(50)," & "DvdName NVarchar(50)," & "SeqNo1 NVarchar(50)," & "SeqNo2 NVarchar(50)," & _
  4.             "JobCode NVarchar(50)," & "ClientCode NVarchar(50)," & "TotalImages NVarchar(50)," & "TotalRecs NVarchar(50)," & "BatchCount NVarchar(50)," & "BatchDate NVarchar(50)," & "BatchSize NVarchar(50)," & "CONSTRAINT [pk_RecNum] PRIMARY KEY (RecNum)) ", conns)
  5.             conns.Open()
  6.  
  7.  
  8. 'Convert into xlsx
  9.             Dim AccessCommand As New System.Data.OleDb.OleDbCommand("SELECT * INTO [Excel 12.0 Xml;DATABASE=C:\Users\admin\Documents\New folder (7)\CBATCH\DDCOS.xlsx;HDR=Yes;].[DDCOS] from [DDCOS]", conns)
  10.  
  11.             cmdd.ExecuteNonQuery()
  12.  
  13.             conns.Close()
  14.             GC.Collect()
  15.             GC.WaitForPendingFinalizers()
  16.  


I can convert it to xlsx but the column fields and values of the database was nothing inside of the xlsx. can someone help me?
Jan 29 '16 #1
0 1131

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Faith | last post by:
Hello. I need to take a column from Excel(unknown amount of rows) that will be selected by the user and copy those cells. Then I will need to paste those cells into the first column in a Data...
1
by: rama | last post by:
I need to convert excel file to txt file programatically which may contain 60000 records i want to convert it into txt file and upload it into unix server thanks in advance rama
1
by: Alice | last post by:
Does anybody knows how to do the above mentioned? Please see below for the codes used for VB. I need codes for VB .Net 03 doing the same thing. TIA for any help. strSQL = "SELECT...
1
by: dimitri | last post by:
i try to copy data from excel into my MySql database which runs on a linux. i use MS Access to access the database. i need to optain the unique id number, and this is where i have some troubles....
1
by: Arvind P Rangan | last post by:
Hi, Trying to convert excel file data to base64 for encryption. Can anyone help me on this. Thanks Arvind
2
by: noopathan | last post by:
Hi experts , I have an excel file in the below format --------------------------------------------------------------------- CodeID CodeName Market Name Date...
0
by: Dodong | last post by:
Hi, i am a new vb6 programmer. I would like to know the vb6 code to read excel file and save it to access database. I am using ADO.
2
kamill
by: kamill | last post by:
I need to convert excel file into PDF file using PHP, how can i do it. I am able to generate a pdf file. Is there any solution to export excel data into mysql database? I am waiting for help.
2
by: vinitaJ | last post by:
hi i need to convert a excel sheet to mysql database format using php code.I am not getting any help on the net on this topic.I need the code not an autogeneration tool.If any of you can solve the...
0
by: Raymond Chiu | last post by:
Dear all, In my vb.net program, I am using excel object to create excel file and stored in a folder. How can it be converted to be pdf file automatically using dotnet coding or others? Actually...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.