-
I posted this under General Q's too, but I think it belongs here since its DB related.
My application relies on a database, which I connect to via ODBC Data Source on the machine and OLE DB Driver for ODBC within the app. I'm having difficulty packaging my application so that the executable recognizes the database it needs when the whole package is installed on a recipient computer.
What's the best way to handle packaging and deploying data connections without hard-coding connection strings anywhere in your code? I would think that ODBC is the way to go, because once you set up the DSN, the app just needs to know the name, and not the whole connection string... but now I'm discovering that upon installation, the app does not set up a DSN automatically on the recipient machine - this must be done manually for the app to work right! Any ideas? Any advice would be very helpful.
Thanks,
Sabrina
-
Although I'm not really sure where you're headed with your question I'll throw a couple things out there as I just did my first ODBC deployment this week... : )
Here's an example of what I just did:
Set conRMA = New ADODB.Connection 'create connection
Set Send = New ADODB.Command 'create command
strDSN = "RMA"
conRMA.ConnectionString = "DSN=" & strDSN & _
";UID=" & "sa" & _
";PWD=" & "" & _
";DATABASE=RMA"
conRMA.Open 'open the conn
Part of my deployment problem was answered at this thread:
http://forums.vb-world.net/showthrea...threadid=58137
Hope that does more good than harm.
-
Sorry, I just got the gist of your post. You don't want to have to set up the ODBC configuration manually. You may see if there's an API call that could assist in that. Try www.Allapi.net. It's a great resource for API calls. Sorry I couldn't be of more help.
-
yup... part of my problem was that I didn't want to specify a file-path connection string. I did however check out the allapi site and downloaded the api tool. It wasn't much help in this particular case, but I did see a lot of useful api calls that I didn't know existed. Thanks for the tip!
-
Why not use a DSN Less connection ?