[R] RODBC working in Rgui but not Rterm

John Fox jfox at mcmaster.ca
Mon Feb 7 06:41:49 CET 2005


Dear Shlomo,

Just last week I experienced a similar problem with RODBC and MySQL under
Windows, though the problem extended to both Rterm *and* Rgui. After a fair
amount of detective work, I discovered that the source of the difficulty was
a newly downloaded MySQL ODBC Windows driver. When I instead installed a
driver downloaded last December, everything worked fine. I've just confirmed
that I can access MySQL from both Rterm and Rgui. I'm using R 2.0.1 under
Windows XP.

Since your symptoms are slightly different from mine, the ODBC driver may
not be the source of the difficulty, but I thought that it might be
worthwhile to mention it.

Regards,
 John

--------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox 
-------------------------------- 

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch 
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Shlomo 
> Katchmalik
> Sent: Sunday, February 06, 2005 11:03 PM
> To: r-help at stat.math.ethz.ch
> Subject: Re: [R] RODBC working in Rgui but not Rterm
> 
> Oh, I see what you mean now.  Sorry for the misunderstanding.
> 
> I have my local MySQL database set with a very lax level of 
> security, so I don't need to use a password.  All I have 
> needed in the past has been to supply the uid, and everything 
> has worked just fine, both for Rgui and Rterm.  However, I 
> recently reinstalled all of my software and databases on a 
> new machine, and since then, I haven't been able to get RODBC 
> to work from Rterm.
> 
> If I use only odbcConnect("MySQL"), I would previously get 
> the dialog box that you mention.  Now, however, I do not get 
> that dialog box.
> 
> On Mon, 7 Feb 2005 12:32:08 +1000, Andrew Ward 
> <Andrew.Ward at qsa.qld.edu.au> wrote:
> > I wasn't very clear, I'm afraid. When I call odbcConnect 
> from within 
> > Rgui, a dialog box pops up asking me to enter a username 
> and password 
> > (see ?odbcConnect). I wondered if you need to provide these 
> in Rterm 
> > in your call to
> > odbcConnect:
> >         library(RODBC)
> >         con <- odbcConnect(dsn="MySQL", uid="test", pwd="")
> > 
> > 
> > -----Original Message-----
> > From: r-help-bounces at stat.math.ethz.ch 
> > [mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of Shlomo 
> > Katchmalik
> > Sent: Monday, 7 February 2005 11:10 AM
> > To: r-help at stat.math.ethz.ch
> > Subject: Re: [R] RODBC working in Rgui but not Rterm
> > 
> > Thanks for your response.  I'm not aware of passing any 
> arguments to 
> > either Rgui or Rterm.  I have the R\bin subdirectory in my 
> path, so to 
> > run the programs, I simply type "rgui" or "rterm" from the DOS 
> > (actually TakeCommand) prompt.
> > 
> > ---------- Forwarded message ----------
> > From: Andrew Ward <Andrew.Ward at qsa.qld.edu.au>
> > Date: Mon, 7 Feb 2005 10:49:56 +1000
> > Subject: RE: [R] RODBC working in Rgui but not Rterm
> > To: Shlomo Katchmalik <katchmalik at gmail.com>
> > 
> > I wonder if you provide any arguments in Rgui that aren't 
> given with 
> > Rterm? For instance, if in Rgui you get prompted for a username or 
> > password, then these ought to appear in the called to 
> odbcConnect. Can 
> > you let us know if you've already tried this?
> > 
> > Regards,
> > 
> > Andrew C. Ward,                andrew.ward at qsa.qld.edu.au
> > Senior Analyst (Quantitative), Tel: +61 7 3864 0439 
> Queensland Studies 
> > Authority,  Fax: +61 7 3229 3318
> > 295 Ann Street,
> > Brisbane Qld 4000, Australia
> > 
> > -----Original Message-----
> > From: r-help-bounces at stat.math.ethz.ch 
> > [mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of Shlomo 
> > Katchmalik
> > Sent: Monday, 7 February 2005 10:33 AM
> > To: r-help at stat.math.ethz.ch
> > Subject: [R] RODBC working in Rgui but not Rterm
> > 
> > Hello Users:
> > 
> > I'm using R version 2.0.1, and having problems with RODBC.  
> Everything 
> > works fine when I use Rgui, but when I try to use Rterm and 
> issue the 
> > commands
> >   library(RODBC)
> >   con <- odbcConnect("MySQL", "test")
> > 
> > I get the following error:
> > Error in sqlQuery(con, str) : first argument is not an open RODBC 
> > channel In addition: Warning messages:
> > 1: [RODBC] ERROR: state IM008, code 0, message [MySQL][ODBC 3.51 
> > Driver]Invalid window handle for connection completion argument.
> > 2: ODBC connection failed in: odbcDriverConnect(st, case = case, 
> > believeNRows =
> > believeNRows)
> > 
> > Does anybody know how I can fix this problem?
> > 
> > Thanks,
> > Shlomo.
> >
> >
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html




More information about the R-help mailing list