r/visualbasic • • Sep 12 '18

Access DAO to SQL database.

Hello guys,

I've asked this question before, without any success. Now I got a little more experienced, so I'm able to explain myself better.

My company has a huge VB, wich contains of 15000 lines. Now this is connected to a access db, but because it needs to connect to a Maximo environment, it need to change to a sql database.

What are the easy ways or hard ways for me to change this. Or is there even an option to change this?

5 Upvotes

14 comments sorted by

View all comments

2

u/andrewsmd87 Web Specialist Sep 12 '18

You can import an access defense into sql server, just Google that. Then it'd be a matter of changing the connection. Note if it's set up properly that's in one spot. However my experience with legacy stuff using an access database means it's probably not.

In that case, it's a matter of using find and replace and finding all the connections and replacing them with a global connection string.

Obviously you'd want to test everything before doing this in production as access sql doesn't always translate to raw sql ver batim.

If you are thinking this was going to be easy, it won't. Things like this are generally a pretty big undertaking

1

u/Rocket-Reatre Sep 12 '18

Note that I'm a TOTAL beginner in all programming lang. I've tried to find the connections, but without success.

2

u/andrewsmd87 Web Specialist Sep 12 '18

Well that would be step one then. Do a search for your access database file name and see if that comes up anywhere.

If you know any of the table or column names you could search for those as well and then back trace to where the connecting gets open.

I'm curious as to why you have to move to sql to connect into whatever the third party thing is you're talking about.

This is by no means meant to be a slight on you, but you seem woefully inexperienced to be doing something like this. If you're doing it to learn that's great, but if this is some sort of software critical to a business, be careful

1

u/Rocket-Reatre Sep 12 '18

Nah don't stress about it mate. I'm an intern, and I've got a private server where I can do what I want, and they gave me the exact files of what would be the real process. My boss just wants to know how fast I can learn or something like that.

The only thing that needs to happen is as following:

The vb is writting in DAO, wich connects to Access. Now Access can't connect to IBM Maximo.

So what I've tried so far is to change DAO into ADO, only ADO is pretty old, and it made it slower.

2

u/andrewsmd87 Web Specialist Sep 12 '18

Ahh gotcha. Honestly this seems like a pretty big deal for an intern! If you've found the Dao/ado stuff they have to be getting a connection string from somewhere. It's literally a string that says here is where the database is and here's how you connect. So searching for the db name would be a good first step

1

u/Rocket-Reatre Sep 12 '18

Thanks! A colleague almost had the sollution, but gave up because he's a whimp... So I've got all of that information on where all the connection strings are.

He wanted to do it the easy way and connect it trough Access into SQL. Now this was twice as slow, and this vb is of high importance.

So I need to find a propper way thats also atleast as fast a the current one.

Edit: Words

2

u/andrewsmd87 Web Specialist Sep 12 '18

I'm just shooting from the hip but have you tried an oledb provider?

1

u/Rocket-Reatre Sep 12 '18

Just looked that up, is that reliable?

2

u/andrewsmd87 Web Specialist Sep 12 '18

Yes. ADO is actually a wrapper for oledb. That's why it came to mind

1

u/Rocket-Reatre Sep 12 '18

So can you give me a tiny bit more info about it?

→ More replies (0)

1

u/CommonMisspellingBot Sep 12 '18

Hey, Rocket-Reatre, just a quick heads-up:
collegue is actually spelled colleague. You can remember it by -ea- in the middle.
Have a nice day!

The parent commenter can reply with 'delete' to delete this comment.

1

u/chrwei Sep 12 '18

unless you've gotten into some weird old docs, ADO is actually the newer one, but it may also matter which VB version you're using.

ADO shouldn't make the Access db slower. you should actually see almost no speed difference at all.