ODBC Connection Issue

General discussion forum about all databases other than SqlBase.
matelix

ODBC Connection Issue

Post by matelix » 25 Jan 2010, 09:49

Hi everyone, I am using Microsoft SQL Server as my Database server and connecting the databases via ODBC. This is fine and works wonders, however, I have the tedious task of having to go to the ODBC window and adding my database every time I want my software to link up to a new database. Is there a way that I can "tell" the software to automatically create it's own ODBC connection without me having to do it all the time. I can get it to create the database and I can get it to add the database to my connection INI file, but I can't get it to create the database connection in the ODBC automatically. If anyone knows of a way, please help. I'm using Team Developer 4.2.

Thanks.

Jeff Luther

Re: ODBC Connection Issue

Post by Jeff Luther » 27 Jan 2010, 01:49

So you want some code that'll access the ODBC Data Source Administrator, define a new ODBC connection and 'auto-stuff' the parameters for you?

If so, here's something in my 'td barrel' that I downloaded at some point years ago. Looks like it may give you a couple hints on how to begin. 2 apps. show 2 different ways. I didn't write them and I haven't used them, so cannot vouch for them. But maybe a starting point, anyway.
You do not have the required permissions to view the files attached to this post.

matelix

Re: ODBC Connection Issue

Post by matelix » 01 Feb 2010, 12:03

Thanks, i'll have a look at it and get back to you.

gordon345

Re: ODBC Connection Issue

Post by gordon345 » 31 Mar 2010, 16:58

Thanks to this zip file. Can I ask a question here? Thanks for those who will reply. What is the reason every time I exit my program w/c stores data in msaccess the data stored is gone? pls help me.

Jeff Luther

Re: ODBC Connection Issue

Post by Jeff Luther » 31 Mar 2010, 19:19

I don't know. What's "w/c" ?? If there's no COMMIT maybe MS Access does a ROLLBACK on exit?

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 1 guest