Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Converting VB 2008 project that uses Access (OleDB) to Sql

Posted on 2008-10-07
5
Medium Priority
?
327 Views
Last Modified: 2012-06-21
What is the best way to modify a [fairly large] VB 2008 project which connects to an Access database via OleDb to connect to an SQL Server 2008 Express (via SqlCllient) database instead? I tried doing a find-and-replace throughout the entire project from ".OleDb" to ".Sql" and from "OleDb." to "SqlClient.", but it didnt work :) HUNDREDS of errors!!! Is there an easy way of doing this or am I going to have to rewrite the entire application? There a re a few thousand lines of code over about 60 forms :(
0
Comment
Question by:SETP
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 25

Accepted Solution

by:
Luis Pérez earned 750 total points
ID: 22659609
Mmmm... for that reason is highly recommended to use layer architecture when designing & programming... if your data access code would be written & coded only in one layer (class library project), you'll only need to do the changes there without modifying any other code... So I recommend to you strongly use this approach in your future developments.
0
 
LVL 48

Assisted Solution

by:jpaulino
jpaulino earned 750 total points
ID: 22659856

>> HUNDREDS of errors!!!
Did you select in the find-and-replace window to work on hidden text also ? It's normal to give some errors but not too many ... or you have used the wizards to fill some controls ?
0
 
LVL 25

Assisted Solution

by:Luis Pérez
Luis Pérez earned 750 total points
ID: 22659948
Also, there is an additional problem. How are you accesing the data in MS Access database? Via Queries, or directly with SQL written in your source code? Note that SQL syntax is different between MS Access SQL and Transact SQL of SQL Server.
0
 

Author Comment

by:SETP
ID: 22660247
Thanks for all the replies. jpaulino, yes I did select to work on hidden text. RolandDeschain, in some parts I access the data via SQL queries (executing an OleDbCommand connected to an OleDbConnection). Other places I simply drag-and-dropped a table from Visual Studio's "Data Sources" window onto the form. This automatically created a DataGridView with a TableAdapters and BindingSources. The DatagGridView is database-agnostic, but I'm not so sure about the other two. I'm beginning to think I might have to rewrite the whole damn thing :(
0
 
LVL 48

Assisted Solution

by:jpaulino
jpaulino earned 750 total points
ID: 22660319
>> Other places I simply drag-and-dropped a table from Visual Studio's "Data Sources" window onto the form.
I have used the wizards !!! This way you have to change it manually. I suggest that you don't use it again and do that in the code.
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question