On Mon, 21 Jan 2013 22:07:44 -0800 (PST), Jason Bodine
<
jbodi...@gmail.com> wrote:
> Well, aside from the fact that *every single tutorial* when I type
ADO.NET
> into Google uses the COM objects and uses the very type of code I posted
> here (and somehow it works for *them*, lol), the problem with using
>
ADO.NET is that it's a lot
> more complicated than I'm used to. I am a Classic VB veteran, and in fact
> the application that I'm working on converting was originally written in
> VB6. Only reason I'm trying to port it over to 2010 is I need the added
> functionality of *that* language
> to apply some of the more major updates I have in mind for this version
> of the application. The database part, while vital its operation, doesn't
> need all that added hooplah. It just needs to be able to create the
> database and then store to and retrieve
> information from it.
>
Deanne's suggestion to port to ADO.Net is probably best. But, if you
want to stay with the ADO COM/OLE solution, there is no reason it
shouldn't work as expected.
As John Paine noted, I too have discovered on occasion that 'less
complete' (for lack of a better term) connnection strings can fail on
newer Windows platforms and from within a managed environment.
For this reason it is useful to use the Data Link Properties dialog to
create, configure, and test ADO connection strings. This can be done
within YOUR specific problem domain, and cuts down on error-prone, hit
'n miss, re-typing.
Using Explorer go to the project folder.
Create an empty file with the .UDL extension. (eg, "myapp.udl").
Double-click on the file.
This will open the Data Link Properies dialog.
You should be able to figure out what to do from there.
Particualarly note that after you selected your options you can then
TEST the connection.
[There is also a .Net tool for working with .udl, but I still find
this simple method the easiest.]
At this point there are two ways to use the .udl.
1) You can use the udl file directly as in ...
sConnection = "File Name=c:\myproject\myapp.udl"
Handy if you want to change the connection outside the Application
during development or while in production.
2) Or simple open the .udl file in notepad (or with any text editor)
and copy the connection string directly into your application.
I'm still not totally convinced it is your connection string that is
the problem. Unable however to see any thing wrong with your code -
which simply means it is likely very obvious and I'm just blind - <bg>
hth
-ralph