Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2008-10-07
5
Medium Priority
?
330 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
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

972 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