hello

what is the exact code in saving visual basic using ms excel as database?

i want to save my data in the form of visual basic into excel as database..what is the exact code in my cmdSave command button?

thanks in advance...

try this

Dim cn as ADODB.Connection
Set cn = New ADODB.Connection
With cn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Data Source=C:\MyFolder\MyWorkbook.xls;" & _
"Extended Properties=Excel 8.0;"
.Open
End With

don't forget to replace "C:\MyFolder\MyWorkbook.xls" with the path and filename of your project

Is there a specific reason you are using excel as a database? It is not a very scalable method. If your users really need to access the data as an excel spreadsheet you can always give them the option to export smaller sets of data through excel.

I say this having developed applications in access, only to port them to SQL Server later on because access kept crashing with lots of data. Excel is similar, when your application is several years old with lots of data things start breaking.

Think about the whole life cycle of your application. Just some food for thought.

This article has been dead for over six months. Start a new discussion instead.