After a few days of deserved rest, here we get back to work! No that I want to, but I'm sure you are all waiting for new posts ... ... ... or not?
In the following short article I would like to list all possible database connection strings, just in case you need them in your projects. We will see just the basic way of connecting to data sources, so keep in mind that specific additional security parameters may be used, in case you need them.
Ready? Then please follow me...
Here is the list! I divided it into different sections, so that it might be easier to find what needed.
Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;
Access 2007 (OLEDB 12.0)
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\Access2007File.accdb;Persist Security Info=False;
We need to specify the "store" in the connection open command. An example:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcelFile.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1";
"HDR=Yes;" indicates that the first row contains column names, and not data. "HDR=No;" obviously indicates tha there are no column names.
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\myFolder\MyExcel2007file.xlsx;Extended Properties="Excel 12.0 Xml;HDR=YES";
Ok, that's all for today. If you need to add something, please use the comments section below.