Re: [GRASS-user] Error while creating vectorial file in WinGRASS

2010-08-03 Thread Hamish
You need to run db.connect to select a database backend to use
first. (There is no VAR file in the mapset yet)

Manage databases -> connect

see the help page for details, I usually just cut and paste out of the 
examples. v.db.addtable can probably do this automatically.

Vector database connections -> New Table

Most modules should create the connection if needed using the default
DB (dbf in grass 6.4) if it is needed, but because db.execute is "raw"
perhaps it shouldn't and whatever in the GUI is calling that should
check that first.

Hamish


Kim Besson wrote:
- Error in command execution db.executeExecution failed: 'db.execute 
--q'Details: Error: Unable to start driver <(null)>
And the following is printed in Command Output:
Traceback (most recent call last):  File "C:/GRASS6/etc/wxpython/wxgui.py", 
line 546, inOnNewVector
cmdDef=(['v.edit', 'tool=create'], "map"))
  File "C:\GRASS6\etc\wxpython\gui_modules\gdialogs.py",line 192, in 
CreateNewVector
stdin=sql)  File "C:\GRASS6\etc\wxpython\gui_modules\gcmd.py", line
369, in __init__
_("Error: ") + self.GetError()))gui_modules.gcmd.CmdErrorTraceback (most recent 
call last):  File "C:/GRASS6/etc/wxpython/wxgui.py", line 546, in
OnNewVector
cmdDef=(['v.edit', 'tool=create'], "map"))  File 
"C:\GRASS6\etc\wxpython\gui_modules\gdialogs.py",line 192, in CreateNewVector

stdin=sql)  File "C:\GRASS6\etc\wxpython\gui_modules\gcmd.py", line369, in 
__init__
_("Error: ") + self.GetError()))gui_modules.gcmd
.CmdError
I believe this was not expected but, what might be wrong?
Thanks
Kim
I have installed WinGRASS-6.4.SVN-r42868-1-Setup.exe in my WinXP machine and, 
when I  select Vector/Develop Vector Map/Create new vector map, I place output 
name and check Create Attibute table I get an error windows stating:



  ___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Error while creating vectorial file in WinGRASS

2010-08-04 Thread Hamish
Hamish wrote:
> You need to run db.connect to select a database backend to
> use first. (There is no VAR file in the mapset yet)

hopefully fixed & ready for testing in 6.5svn r42988 (v.edit).


devs:
 maybe do this for 'v.in.ascii -e' and 'v.digit -n' too?
 or move this into Vect_open_new() ?  ... but I'm not totally
convinced that's the right place for it either; the mapset may
come from an earlier version of GRASS. perhaps db.execute
instead of exiting with an error.


#include 
...
  if (! db_get_default_driver_name() ) {
  G_message(_("Creating new DB connection based on default mapset 
settings..."));
  db_set_default_connection();
  }


see bug #7  http://trac.osgeo.org/grass/ticket/7


Hamish




  
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Error while creating vectorial file in WinGRASS

2010-08-04 Thread Markus Metz
Hamish wrote:
> Hamish wrote:
>> You need to run db.connect to select a database backend to
>> use first. (There is no VAR file in the mapset yet)
>
> hopefully fixed & ready for testing in 6.5svn r42988 (v.edit).
>
>
> devs:
>  maybe do this for 'v.in.ascii -e' and 'v.digit -n' too?
>  or move this into Vect_open_new() ?

Not to Vect_open_new(), a GRASS vector does not need to have a DB
connection, this is optional.

Markus M


... but I'm not totally
> convinced that's the right place for it either; the mapset may
> come from an earlier version of GRASS. perhaps db.execute
> instead of exiting with an error.
>
>
> #include 
> ...
>  if (! db_get_default_driver_name() ) {
>      G_message(_("Creating new DB connection based on default mapset 
> settings..."));
>      db_set_default_connection();
>  }
>
>
> see bug #7  http://trac.osgeo.org/grass/ticket/7
>
>
> Hamish
>
>
>
>
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Error while creating vectorial file in WinGRASS

2010-08-04 Thread Kim Besson
Hi there
Regarding Hamish suggestion "
You need to run db.connect to select a database backend to use
first. (There is no VAR file in the mapset yet)
The thing is: I have been using an WinGRASS6.4 binary version where I didn't
need to do anything else. Just create Vector by doing this. So, my question
is, why was this disabled? Or is it some error that only occurs in this
release?

About
hopefully fixed & ready for testing in 6.5svn r42988 (v.edit).
Will it be available for 6.4 in Windows?
Thanks
Kim
2010/8/4 Markus Metz 

> Hamish wrote:
> > Hamish wrote:
> >> You need to run db.connect to select a database backend to
> >> use first. (There is no VAR file in the mapset yet)
> >
> > hopefully fixed & ready for testing in 6.5svn r42988 (v.edit).
> >
> >
> > devs:
> >  maybe do this for 'v.in.ascii -e' and 'v.digit -n' too?
> >  or move this into Vect_open_new() ?
>
> Not to Vect_open_new(), a GRASS vector does not need to have a DB
> connection, this is optional.
>
> Markus M
>
>
> ... but I'm not totally
> > convinced that's the right place for it either; the mapset may
> > come from an earlier version of GRASS. perhaps db.execute
> > instead of exiting with an error.
> >
> >
> > #include 
> > ...
> >  if (! db_get_default_driver_name() ) {
> >  G_message(_("Creating new DB connection based on default mapset
> settings..."));
> >  db_set_default_connection();
> >  }
> >
> >
> > see bug #7  http://trac.osgeo.org/grass/ticket/7
> >
> >
> > Hamish
> >
> >
> >
> >
> >
> > ___
> > grass-user mailing list
> > grass-user@lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/grass-user
> >
>
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Error while creating vectorial file in WinGRASS

2010-08-04 Thread Hamish
Kim wrote:
> Hi there
>Regarding Hamish suggestion "You need to run db.connect to select a
> database backend to use first. (There is no VAR file in the mapset
> yet)
> The thing is: I have been using an WinGRASS6.4 binary version where I
> didn't need to do anything else. Just create Vector by doing this. So,
> my question is, why was this disabled? Or is it some error that only
> occurs in this release?

the GUI is making the assumption that the mapset will already have a
database link. I don't know when that started. This usually happens for
you when you first create a map in the mapset which uses a database table.
Modules should create that for you if it is needed, but some do not and so
the GRASS startup script for unix was changed to automatically set the
default if it wasn't set already. The Windows startup script does not set
the default DB for you (in the mapset's "VAR" file) apparently.
(see bug #7)

Perhaps if you start "GRASS with MSys" the unix startup script might be
used and then it might work from that mapset?? (not sure)


> About
> > hopefully fixed & ready for testing in 6.5svn r42988 (v.edit).
> Will it be available for 6.4 in Windows?

I am not totally happy with that work-around, once we decide on the
correct solution it will of course be backported to 6.4. GRASS 6.5 and 7
are for experimenting to find the best solution, which is the stage this
is currently at.


regards,
Hamish



  
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user