Access --> SQL

Not sure where to post this, so will start here.

I have written an application which links to a MS Access mdb as a data source.

I now need to migrate this to MS SQL. I have imported the tables into SQL ans recreated the views (query).

However, I want to change the Data source in my VS2005 - VB app. Everything is the same name wise etc.

Is there an easy way to achieve this? and will I need to recreate those query (fill) that I have attached to the tables internally?

Any advice would be greatly appreciated.

Many thanks in advance (i hope!) :-D

[590 byte] By [JasW] at [2007-12-24]
# 1
All you should have to do is to change the Data namespace from oledb to sqlclient...update your connectionstring and refresh all of your tableadpaters
DMan1 at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2

Thanks Dman1.

I used the wizard to add a data source and cant seem to edit it from the configuration. Can I manually edit the data namespace and if so, where do I find it?

When you say refresh your tableadapters, where do you refer? in the xsd or in each page they are referenced?

Thanks for your assistance

JasW at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 3

Sorry for the disjointed manner of this answer. please read ALL of it before applying anything.

<connectionStrings>
<
add name="dbname.My.MySettings.dataConnectionString"
connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Dist\data.mdb"
providerName="System.Data.OleDb" />
</
connectionStrings>

I presume this is the location within the app.config The connection string will be changed if you edit the properties of the project.

edit:- There is also a connection string within the .xsd. Right click and open with: XML editor
edit the connection line near the top to show Provider="System.Data.SqlClient" instead of the OLEDB.

After you have made these 2 changes things seem to work!

edit:- Oh the Naivety

You need to recreate all .insert .update and .delete for each table adapter

edit:- and theres more
Change the string in the property of the project and when it asks update the .settings values.

When you see a million errors, dont panic! Just save everything and it should resolve them. You still need to recreate the inserts etc.

JasW at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...