I am pretty sure that when you add a .MDF file directly to your application you ultimately wind up with a connection string similar to this:
Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|\database.MDF;Integrated Security=True;User Instance=True"
Which attaches the specified .mdf file to the SQL Server specified as the DataSource.
SQL Server Compact is the replacement for SQL Server CE (Compact Edition) which allows for a distributed date model but still requires that the SQL Server CE runtime be on the client. Be warned however, while this is a very nice platform, you will find alot of the more advanced SQL Commands will nto work. (Unless this has changed between CE and the new version that is.) For more infomration you can check out this doc:
http://msdn2.microsoft.com/en-us/library/aa983341.aspx
To reiterate my previous posts, you will need to build the SQL Commands in code and execute them against the datasource. In so far as getting the column name of a given table you could fill a DataSet or a DataTable and do something like:
For Each dt as DataTable in ds.Tables
For Each dr as DataRow in dt.Row
For Each dc as DataColumn in dr.Columns
Dim s as String = dc.Caption
Next
Next
Next
or code similar to that.
I assume that 'SQL Server Compact 3.5' is the new version of SQLExpress? is this correct? No its the new version of SQL Server CE.
lso.. if I were to just use mdb files, in a non SQL server environment, would the program work with the mdb file even if the user does not have Access on their computer (because
VB is taking the job over for access) or would Access still be required. - You wouldn't need to have access on their pc's but, if memory servers me, you would need the .MDB driver.
hth
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor / Author :.
Wrox Books 24 x 7
================================================== =========