I am aware of the 'hack the registry' approach. This is just not a safe way to accomplish this on a user's PC. I need to do this the right way. Is there anyone -perhaps from Microsoft - out there who can assist me on this?
"Colin Stutley" wrote:
[color=blue]
> I now see your dilemma.
>
> Not sure of the appropiate API calls, but an alternative may be to simple
> add the appropiate registry entries for the DSN. I would try;
> 1) Export your registry to a disk file,
> 2) Create a new DSN with your desired properties via the control panel
> applet,
> 3) Export your registry to a second disk file
> Comparing the 2 export images should give you a snapshot of what registry
> entries are being created, which you may then be able to insert via you .Net
> app. Not "by the book" Im sure, but it may prove just as effective.
>
> - Colin
>
> "Lewt" wrote in message
>[color=green]
> > Colin, thanks for your quick response. I know all about the OLE stuff.[/color]
> Yes, it works great. Unfortunately, some of us don't have the liberty of
> being able to utilize that.[color=green]
> >
> > I am creating a deployment project in which I do not have control over the[/color]
> source code for the original application. Unfortunately, for me, this app
> uses ODBC DSNs to connect to multiple access databases. This means that on
> the target computer I need the ability to create those DSNs - since asking
> the user to figure out the ODBC Administrator is way too much to ask of the
> users these days.[color=green]
> >
> > Please pardon me if I'm laying it on thick, but I've been scowering the[/color]
> Internet looking for this missing link (between C# & the .NET framework and
> this MFC? SQLConfigDataSo ure function), but all I can find is several people
> asking and responses of alternative methodologies.[color=green]
> >
> > I know it can be done - there is a company out there who has done it and[/color]
> is selling the code. Unfortunately, I paid them the money and they ave not
> delivered the code - legal proceedings may be forthcoming. In the meantime,
> does anyone know how to do this? Thanks!![color=green]
> >
> > -Lewt
> >
> > "Colin Stutley" wrote:
> >[color=darkred]
> > > Have you looked at OLEDb rather than ODBC?
> > > To get to your access database you could establish a connection via;
> > > string vConStr = "Provider=Micro soft.Jet.OLEDB. 4.0;"
> > > + "Data Source=C:\\Test db.mdb;"
> > > + "User ID=Admin;Passwo rd=MyPassword;" // optional
> > > + "Jet OLEDB:Database Password=DevId" ; //optional
> > > System.Data.Ole Db.OleDbConnect ion vDatabase = new[/color][/color]
> OleDbConnection (vConStr);[color=green][color=darkred]
> > > vDatabase.Open( );
> > > The ODBC and OLEDb methods are very similar from this point on.
> > >
> > > OR
> > >
> > > If you already have the MSAccess ODBC drivers installed you do not need[/color][/color]
> to[color=green][color=darkred]
> > > create a specific DSN for your individual connection. eg,
> > > string vConStr = "Driver={Micros oft Access Driver (*.mdb)};"
> > > + "DBQ=C:\\Testdb .mdb;UID=;PWD=; ";
> > > System.Data.Odb c.OdbcConnectio n vDatabase = new OdbcConnection( vConStr);
> > >
> > >
> > > - Colin.
> > >
> > >
> > > "Lewt" wrote in message
> > >
> > > > I am also interested in a detailed description of this... I have read
> > > everything I can find on the SQLConfigDataSo urce function. Does anyone[/color][/color]
> know[color=green][color=darkred]
> > > how to implement this within C#.net - (i.e. add a MS Access DSN to[/color][/color]
> System[color=green][color=darkred]
> > > DSNs)? Thanks!
> > > > -Lewt
> > > >[/color]
> >[/color]
>
>
>[/color]
"Colin Stutley" wrote:
[color=blue]
> I now see your dilemma.
>
> Not sure of the appropiate API calls, but an alternative may be to simple
> add the appropiate registry entries for the DSN. I would try;
> 1) Export your registry to a disk file,
> 2) Create a new DSN with your desired properties via the control panel
> applet,
> 3) Export your registry to a second disk file
> Comparing the 2 export images should give you a snapshot of what registry
> entries are being created, which you may then be able to insert via you .Net
> app. Not "by the book" Im sure, but it may prove just as effective.
>
> - Colin
>
> "Lewt" wrote in message
>[color=green]
> > Colin, thanks for your quick response. I know all about the OLE stuff.[/color]
> Yes, it works great. Unfortunately, some of us don't have the liberty of
> being able to utilize that.[color=green]
> >
> > I am creating a deployment project in which I do not have control over the[/color]
> source code for the original application. Unfortunately, for me, this app
> uses ODBC DSNs to connect to multiple access databases. This means that on
> the target computer I need the ability to create those DSNs - since asking
> the user to figure out the ODBC Administrator is way too much to ask of the
> users these days.[color=green]
> >
> > Please pardon me if I'm laying it on thick, but I've been scowering the[/color]
> Internet looking for this missing link (between C# & the .NET framework and
> this MFC? SQLConfigDataSo ure function), but all I can find is several people
> asking and responses of alternative methodologies.[color=green]
> >
> > I know it can be done - there is a company out there who has done it and[/color]
> is selling the code. Unfortunately, I paid them the money and they ave not
> delivered the code - legal proceedings may be forthcoming. In the meantime,
> does anyone know how to do this? Thanks!![color=green]
> >
> > -Lewt
> >
> > "Colin Stutley" wrote:
> >[color=darkred]
> > > Have you looked at OLEDb rather than ODBC?
> > > To get to your access database you could establish a connection via;
> > > string vConStr = "Provider=Micro soft.Jet.OLEDB. 4.0;"
> > > + "Data Source=C:\\Test db.mdb;"
> > > + "User ID=Admin;Passwo rd=MyPassword;" // optional
> > > + "Jet OLEDB:Database Password=DevId" ; //optional
> > > System.Data.Ole Db.OleDbConnect ion vDatabase = new[/color][/color]
> OleDbConnection (vConStr);[color=green][color=darkred]
> > > vDatabase.Open( );
> > > The ODBC and OLEDb methods are very similar from this point on.
> > >
> > > OR
> > >
> > > If you already have the MSAccess ODBC drivers installed you do not need[/color][/color]
> to[color=green][color=darkred]
> > > create a specific DSN for your individual connection. eg,
> > > string vConStr = "Driver={Micros oft Access Driver (*.mdb)};"
> > > + "DBQ=C:\\Testdb .mdb;UID=;PWD=; ";
> > > System.Data.Odb c.OdbcConnectio n vDatabase = new OdbcConnection( vConStr);
> > >
> > >
> > > - Colin.
> > >
> > >
> > > "Lewt" wrote in message
> > >
> > > > I am also interested in a detailed description of this... I have read
> > > everything I can find on the SQLConfigDataSo urce function. Does anyone[/color][/color]
> know[color=green][color=darkred]
> > > how to implement this within C#.net - (i.e. add a MS Access DSN to[/color][/color]
> System[color=green][color=darkred]
> > > DSNs)? Thanks!
> > > > -Lewt
> > > >[/color]
> >[/color]
>
>
>[/color]