Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2008 > Visual Basic 2008 Essentials
|
Visual Basic 2008 Essentials If you are new to Visual Basic programming with version 2008, this is the place to start your questions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2008 Essentials section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 25th, 2008, 08:05 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

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
================================================== =========
 
Old February 29th, 2008, 03:08 PM
Authorized User
 
Join Date: Oct 2006
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Check out this thread for another well done example:

http://forums.microsoft.com/MSDN/Sho...88163&SiteID=1

Now if I can convert this example to SQLExpress!








Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Creation paribaranwal C# 1 June 11th, 2008 03:11 AM
how to get all the tables from a database rakeshgv SQL Server 2000 4 December 1st, 2006 08:33 AM
Code to Detach Tables SerranoG Access VBA 1 February 9th, 2006 06:15 PM
regarding tables creation in xslt barsha XSLT 0 September 28th, 2005 07:50 AM
User Creation in SQL Server Database angie C# 1 June 12th, 2003 04:32 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.