I am trying to get an ODBC connection created from a commandline, I
have created the ODBC connection, exported the registry key, and have
tried doing regedit /s "regkey", problem is after I do that it never
shows us in the ODBC manager, it shows up in the registry under
ODBC.INI\Source, but I dont see it in the manager, any ideas?
"Duane Haas" <techsupport@.suduhaas.com> wrote in message
news:uUTjiBQcFHA.2212@.TK2MSFTNGP14.phx.gbl...
>I am trying to get an ODBC connection created from a commandline, I
> have created the ODBC connection, exported the registry key, and have
> tried doing regedit /s "regkey", problem is after I do that it never
> shows us in the ODBC manager, it shows up in the registry under
> ODBC.INI\Source, but I dont see it in the manager, any ideas?
Are you adding a value to the ODBC Data Sources key as well as the database
connection key values?
David Rowland
DBMonitor version 1.2 out now! http://dbmonitor.tripod.com
Email Alerts, logging, performance stats, process information!
Only $49.95
|||dbmonitor wrote:
> "Duane Haas" <techsupport@.suduhaas.com> wrote in message
> news:uUTjiBQcFHA.2212@.TK2MSFTNGP14.phx.gbl...
> Are you adding a value to the ODBC Data Sources key as well as the
> database connection key values?
Yes, it creates the key, and all the values. I just export it from
another machine that already has the connection.
|||"Duane Haas" <techsupport@.suduhaas.com> wrote in message
news:uUMF6ZndFHA.1456@.TK2MSFTNGP15.phx.gbl...
> dbmonitor wrote:
>
> Yes, it creates the key, and all the values. I just export it from
> another machine that already has the connection.
Are you able to post the reg settings you are adding?
David Rowland
DBMonitor version 1.2 out now! http://dbmonitor.tripod.com
Email Alerts, logging, performance stats, process information!
Only $49.95
Showing posts with label registry. Show all posts
Showing posts with label registry. Show all posts
Monday, March 26, 2012
ODBC Creation from commandline
I am trying to get an ODBC connection created from a commandline, I
have created the ODBC connection, exported the registry key, and have
tried doing regedit /s "regkey", problem is after I do that it never
shows us in the ODBC manager, it shows up in the registry under
ODBC.INI\Source, but I dont see it in the manager, any ideas?"Duane Haas" <techsupport@.suduhaas.com> wrote in message
news:uUTjiBQcFHA.2212@.TK2MSFTNGP14.phx.gbl...
>I am trying to get an ODBC connection created from a commandline, I
> have created the ODBC connection, exported the registry key, and have
> tried doing regedit /s "regkey", problem is after I do that it never
> shows us in the ODBC manager, it shows up in the registry under
> ODBC.INI\Source, but I dont see it in the manager, any ideas?
Are you adding a value to the ODBC Data Sources key as well as the database
connection key values?
--
David Rowland
DBMonitor version 1.2 out now! http://dbmonitor.tripod.com
Email Alerts, logging, performance stats, process information!
Only $49.95|||dbmonitor wrote:
> "Duane Haas" <techsupport@.suduhaas.com> wrote in message
> news:uUTjiBQcFHA.2212@.TK2MSFTNGP14.phx.gbl...
> Are you adding a value to the ODBC Data Sources key as well as the
> database connection key values?
Yes, it creates the key, and all the values. I just export it from
another machine that already has the connection.|||"Duane Haas" <techsupport@.suduhaas.com> wrote in message
news:uUMF6ZndFHA.1456@.TK2MSFTNGP15.phx.gbl...
> dbmonitor wrote:
>
> Yes, it creates the key, and all the values. I just export it from
> another machine that already has the connection.
Are you able to post the reg settings you are adding?
David Rowland
DBMonitor version 1.2 out now! http://dbmonitor.tripod.com
Email Alerts, logging, performance stats, process information!
Only $49.95
have created the ODBC connection, exported the registry key, and have
tried doing regedit /s "regkey", problem is after I do that it never
shows us in the ODBC manager, it shows up in the registry under
ODBC.INI\Source, but I dont see it in the manager, any ideas?"Duane Haas" <techsupport@.suduhaas.com> wrote in message
news:uUTjiBQcFHA.2212@.TK2MSFTNGP14.phx.gbl...
>I am trying to get an ODBC connection created from a commandline, I
> have created the ODBC connection, exported the registry key, and have
> tried doing regedit /s "regkey", problem is after I do that it never
> shows us in the ODBC manager, it shows up in the registry under
> ODBC.INI\Source, but I dont see it in the manager, any ideas?
Are you adding a value to the ODBC Data Sources key as well as the database
connection key values?
--
David Rowland
DBMonitor version 1.2 out now! http://dbmonitor.tripod.com
Email Alerts, logging, performance stats, process information!
Only $49.95|||dbmonitor wrote:
> "Duane Haas" <techsupport@.suduhaas.com> wrote in message
> news:uUTjiBQcFHA.2212@.TK2MSFTNGP14.phx.gbl...
> Are you adding a value to the ODBC Data Sources key as well as the
> database connection key values?
Yes, it creates the key, and all the values. I just export it from
another machine that already has the connection.|||"Duane Haas" <techsupport@.suduhaas.com> wrote in message
news:uUMF6ZndFHA.1456@.TK2MSFTNGP15.phx.gbl...
> dbmonitor wrote:
>
> Yes, it creates the key, and all the values. I just export it from
> another machine that already has the connection.
Are you able to post the reg settings you are adding?
David Rowland
DBMonitor version 1.2 out now! http://dbmonitor.tripod.com
Email Alerts, logging, performance stats, process information!
Only $49.95
Wednesday, March 7, 2012
Obtaining PATH to master DB
I need to obtain the path to the master DB in a Wise install script. I know that for SQL2K it is in the registry key:
HKLM\Software\Microsoft\MSSQLServer\Setup
It seems that a SQL2005 installation does not have the same default
directory.
Is there a way to query this from the server itself so I don't have to read the registry?With the usual caveat that it is not a 'best practice' to query the system tables, you can find the answer by executing:
SELECT filename
FROM sysfiles
while connected to the master database. You will get two records. One is the data file, one is the log file. You can narrow the query by adding:
WHERE name = 'master'
Regards,
hmscott
Edit to add: I did verify this against a SQL 2005 instance we are running in development, but it will also work in SQL2K.
HKLM\Software\Microsoft\MSSQLServer\Setup
It seems that a SQL2005 installation does not have the same default
directory.
Is there a way to query this from the server itself so I don't have to read the registry?With the usual caveat that it is not a 'best practice' to query the system tables, you can find the answer by executing:
SELECT filename
FROM sysfiles
while connected to the master database. You will get two records. One is the data file, one is the log file. You can narrow the query by adding:
WHERE name = 'master'
Regards,
hmscott
Edit to add: I did verify this against a SQL 2005 instance we are running in development, but it will also work in SQL2K.
Subscribe to:
Posts (Atom)