Re: [R] [RODBC] ERROR: Could not SQLExecDirect

From: Dieter Menne <>
Date: Wed 26 Jul 2006 - 23:30:13 EST

Peter Eiger <Peter.Eiger <at>> writes:

> I've got a problem with RODBC and saving (sqlSave) of a dataframe in Access.
> R 2.0.1 is running on windows XP.
> When executing the examples in R help for the "USArrests" data set "sqlSAve"
works fine, but running
> sqlSave() for a dataframe "Adat"
> > str(Adat)
> `data.frame': 1202 obs. of 18 variables:
> containing 18 columns and ca. 1200 rows fails.
> I get the following error message:
> > sqlSave(channel, Adat)
> Error in sqlSave(channel, Adat) : [RODBC] ERROR: Could not SQLExecDirect
> The data was fetched from the same Access database before and was not
manipulated before the attempt to save.

Try to set rownames = FALSE in sqlSave, it's TRUE by default which I believe is a bit unfortunate. And probably append=TRUE. It's also good to try with fast=FALSE first.

When I get an error of that type, I first save to a non-existing table, and do a compare of what comes out with the original table.

Dieter mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Wed Jul 26 23:37:39 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 27 Jul 2006 - 00:17:07 EST.

Mailing list information is available at Please read the posting guide before posting to the list.