Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Using DNS names to access SQL

Author  Topic 

OMB
Yak Posting Veteran

88 Posts

Posted - 2003-10-03 : 07:33:01
Hi All

Does anyone know if you can use a DSN name to access SQL Server from an appliaction (i.e. VB App , ASP Page) instead of using the SQL Server name or IP address in the connection string.

SQL2000
O.S Server 2003

Thanxs

OMB

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-10-03 : 07:45:43
Yes you can, but you need to use the ODBC provider for OLE DB (MSDASQL instead of SQLOLEDB) in your connection string:

myConnection.Open "Provider=MSDASQL;DSN=myDSN"
Go to Top of Page

OMB
Yak Posting Veteran

88 Posts

Posted - 2003-10-03 : 08:08:11
Cheers rob

Seems like changing all the connection strings is the lesser of two evils at the moment.

Can you help me something else, I know I should really create another post but I'm sure you can give me the answer. I have just installed another SQL server on the domain but forgot to changethe collation setting to the same as the other servers. The other servers are set to
SQL_LATIN_GENERAL_CP1_CI_AS the new server is set to the deafult LATIN_GENERAL_CI_AS will this cause any problems I have looked at BOL but cannot find the differences between the two except that one is case insensitive and accent sensitive.

Cheers

OMB
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-10-03 : 08:13:03
You can change the collation at a database level or a column level. To change the default collation for an entire server would require rebuiling the master database (there's a utility for this). If you check Books Online under "collations, rebuild master" you'll find more information (collations are not a specialty of mine, BOL would be your best guide)
Go to Top of Page

mohdowais
Sheikh of Yak Knowledge

1456 Posts

Posted - 2003-10-03 : 08:13:41
Did you know that you could pass just the DSN name as the connection string and it would still work?

Connection.Open "dsnName"
OR
Connection.Open "UID=username;PWD=password;DSN=dsnName"

Seriously, you should be using a single global connection string, makes life a lot easier...

Since you are using SQL 2000, you dont need to worry about Server-level collations. Each database (even each column) can have its own collation.

Owais


Make it idiot proof and someone will make a better idiot
Go to Top of Page

OMB
Yak Posting Veteran

88 Posts

Posted - 2003-10-03 : 09:56:29
Owais shookran

Can this be used with OLE DB or is what rob says still the case

OMB
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-10-03 : 18:46:48
I'm almost positive that MSDASQL is the default provider, so it should work fine even if you don't specify it.
Go to Top of Page
   

- Advertisement -