Re: [R] Connection to Microsoft SQL Server

2009-05-18 Thread Uwe Ligges



Meenu Sahi wrote:

Dear Users
I am new to R. I'm trying to make a connection to Microsoft SQL Server via
R.
How can I find the correct syntax to make the connection? The Help pdf file
has an example for mySql but there's isnt much on SQL Server.
Please help.
I am trying the following code
library(RODBC)
con-odbcConnect(dbname,hostname)
How do I specify the driver,userid,password etc?


Well, you specify the DSN and other details in your Windows settings 
(somewhere within the control panel) - given your OS is Windows?
If you make a call to connect to that DSN, you will be asked for 
username and password given you haven't specified it with the DSN in 
your Windows settings.


Uwe Ligges



Many thanks for your help!

Me.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Connection to Microsoft SQL Server

2009-05-18 Thread David Scott

On Mon, 18 May 2009, Uwe Ligges wrote:




Meenu Sahi wrote:

Dear Users
I am new to R. I'm trying to make a connection to Microsoft SQL Server via
R.
How can I find the correct syntax to make the connection? The Help pdf file
has an example for mySql but there's isnt much on SQL Server.
Please help.
I am trying the following code
library(RODBC)
con-odbcConnect(dbname,hostname)
How do I specify the driver,userid,password etc?


Well, you specify the DSN and other details in your Windows settings 
(somewhere within the control panel) - given your OS is Windows?
If you make a call to connect to that DSN, you will be asked for username and 
password given you haven't specified it with the DSN in your Windows 
settings.


Uwe Ligges



The process of setting up the DSN name etc for Windows (albeit for MySQL, 
but the change for SQL Server is pretty obvious) is given in the document:


http://www.stat.auckland.ac.nz/~dscott/779/UsingMySQLAndODBC.pdf

David Scott







Many thanks for your help!

Me.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html

and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



_
David Scott Department of Statistics
The University of Auckland, PB 92019
Auckland 1142,NEW ZEALAND
Phone: +64 9 373 7599 ext 85055 Fax: +64 9 373 7018
Email:  d.sc...@auckland.ac.nz

Graduate Officer, Department of Statistics
Director of Consulting, Department of Statistics

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.