Showing posts with label dsn. Show all posts
Showing posts with label dsn. Show all posts

Thursday, March 22, 2012

Deployment Question, Connection string issue.

When we deploy applications, we have been using DSN's set up on the
users systems. Then in the sqlconnection string, we go "dsn = xyz". I
tried this with our new application, which is the first to be done
with ADO.net and I get the following run time problem:

"An exception 'System.ArgumentException' has occured in <Myapp>".
I do the run time debugging and it tells me: "Keyword not supported:
'dsn'.

For those who have migrated to .Net, how do you handle this issue? I
mean, we are going to distribute this application, and our users will
have different names for their servers, so how do we specify a data
source dynamically.

The way we have it for the moment is that we read the information from
a config file. But it seems like there must be a better way. What
happened to dsn?

Any help on this would greatly appreciated.
Thanks,
Ed Hawkes
olaamigoquepasa@.nospamplease-hotmail.comEd Hawkes (olaamigoquepasa@.hotmail.com) writes:
> When we deploy applications, we have been using DSN's set up on the
> users systems. Then in the sqlconnection string, we go "dsn = xyz". I
> tried this with our new application, which is the first to be done
> with ADO.net and I get the following run time problem:
> "An exception 'System.ArgumentException' has occured in <Myapp>".
> I do the run time debugging and it tells me: "Keyword not supported:
> 'dsn'.
> For those who have migrated to .Net, how do you handle this issue? I
> mean, we are going to distribute this application, and our users will
> have different names for their servers, so how do we specify a data
> source dynamically.
> The way we have it for the moment is that we read the information from
> a config file. But it seems like there must be a better way. What
> happened to dsn?

If you despearately need DSN, I would suppose you could use OleDb
client rather than SqlClient.

As for what happened, I guess DSN got of fashion, and I can't say that
I miss it. Our application - which is VB6 - once used DSN, but now you
can specify server and database on the login form (and the values are
saved in registry between invocations), which I very much like. Of course,
end users normally use the same server and database, and it's only
developers like me, who change all the time. But nevertheless, DSNs
is just one more thing that has to be configured, and which could buy
settings you did not expect.

IF you don't want to prompt your users, a config file seems like a
good way to go.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Erland Sommarskog <esquel@.sommarskog.se> wrote in message news:<Xns952AF310B27FBYazorman@.127.0.0.1>...
> Ed Hawkes (olaamigoquepasa@.hotmail.com) writes:
> > When we deploy applications, we have been using DSN's set up on the
> > users systems. Then in the sqlconnection string, we go "dsn = xyz". I
> > tried this with our new application, which is the first to be done
> > with ADO.net and I get the following run time problem:
> > "An exception 'System.ArgumentException' has occured in <Myapp>".
> > I do the run time debugging and it tells me: "Keyword not supported:
> > 'dsn'.
> > For those who have migrated to .Net, how do you handle this issue? I
> > mean, we are going to distribute this application, and our users will
> > have different names for their servers, so how do we specify a data
> > source dynamically.
> > The way we have it for the moment is that we read the information from
> > a config file. But it seems like there must be a better way. What
> > happened to dsn?
> If you despearately need DSN, I would suppose you could use OleDb
> client rather than SqlClient.
> As for what happened, I guess DSN got of fashion, and I can't say that
> I miss it. Our application - which is VB6 - once used DSN, but now you
> can specify server and database on the login form (and the values are
> saved in registry between invocations), which I very much like. Of course,
> end users normally use the same server and database, and it's only
> developers like me, who change all the time. But nevertheless, DSNs
> is just one more thing that has to be configured, and which could buy
> settings you did not expect.
> IF you don't want to prompt your users, a config file seems like a
> good way to go.

Erland,
much obliged! I really appreciate the response, and this will help
move our project along. Thanks again.
Cheers,
Ed Hawkessql

Monday, March 19, 2012

Deploying System DSN to Multiple PCs

Is there any way to deploy System DSNs to multiple PCs?
I'm in a windows xp client environment with sql server 2000 running on a
windows server 200 box.
Thanks for any help.
System DSNs are stored in the registry under
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI. Try exporting the registry node
for the data source and run it on another computer to see if it works.
Roman
Roman Rehak, MCSD, MCDBA, MCSA
SQL Server Specialist
Competitive Computing
http://sqljunkies.com/WebLog/Roman
"Josh" <Josh@.discussions.microsoft.com> wrote in message
news:FA14A0DA-A2C4-4779-ADDC-49F79016EF6E@.microsoft.com...
> Is there any way to deploy System DSNs to multiple PCs?
> I'm in a windows xp client environment with sql server 2000 running on a
> windows server 200 box.
> Thanks for any help.
|||Thanks for replying but that didn't work. I was thinking maybe there might
be a way to create a vbscript to create the system dsns.
"Roman Rehak" wrote:

> System DSNs are stored in the registry under
> HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI. Try exporting the registry node
> for the data source and run it on another computer to see if it works.
> Roman
>
> Roman Rehak, MCSD, MCDBA, MCSA
> SQL Server Specialist
> Competitive Computing
> http://sqljunkies.com/WebLog/Roman
>
> "Josh" <Josh@.discussions.microsoft.com> wrote in message
> news:FA14A0DA-A2C4-4779-ADDC-49F79016EF6E@.microsoft.com...
>
>
|||These articles might help you get going with this:
How To Create and Remove a DSN in Visual Basic
http://support.microsoft.com/?id=171146
How To Programmatically Create a DSN for SQL Server with VB
http://support.microsoft.com/?id=184608
-Sue
On Sun, 27 Feb 2005 21:47:01 -0800, "Josh"
<Josh@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>Thanks for replying but that didn't work. I was thinking maybe there might
>be a way to create a vbscript to create the system dsns.
>
>"Roman Rehak" wrote: