Whitout -M web2py DAL does not know which tables exist and must be exported/imported.
On Nov 15, 9:39 pm, mart <msenecal...@gmail.com> wrote: > quick question... I think i would like to run this script (export > mssql db to cvs) with dal stand alone... since this ia production > server I would want to run it as simple scheduled executable - just > the script sitting on the gluon folder. Am I still able to force the > script to look at the the module with the -M ? > > Thanks, > > Mart :) > > On Nov 15, 6:17 pm, mart <msenecal...@gmail.com> wrote: > > > ah,.... no, I was not using that, but will give it a go now :) thanks > > for that :) > > > Here is something that I would like to understand and possibly fix > > (and maybe those cmd switches will fix it > > ?) While I was able to connect to the mssql db locally, doing > > db.tables returned an empty list... But, i could see the tables, etc, > > using something like razor... Could it be because of the state of the > > DB? its sitting on SQL server 2005, and I can almost guarantee that it > > was never maintained (at least don't see any evidence of that)... or > > maybe, that should not matter? > > > Thanks > > > Mart :) > > > On Nov 15, 10:14 am, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > > This is the correct syntax. > > > > db.export_to_csv_file(open('somefile.csv', 'wb')) > > > > the problem is that db.does not see the models. Are you using? > > > > python -S app -M -N -R yourscript.py > > > > On Nov 15, 12:39 am, mart <msenecal...@gmail.com> wrote: > > > > > Hi, > > > > > Since connecting remotely is an issue for now, I went to the server > > > > hosting the MSSQL DB. > > > > > I am cinnecting fine (to localhost), but this cmd : > > > > > db.export_to_csv_file('quickbuild.csv') > > > > > is getting this error: > > > > > File "C:\Documents and Settings\buildmonkey\Desktop\blue_framework > > > > copy\src\mssql_test.py", line 33, in main > > > > db.export_to_csv_file('quickbuild.csv') > > > > ... > > > > dal.py", line 2193, in export_to_csv_file > > > > ofile.write('END') > > > > AttributeError: 'str' object has no attribute 'write' > > > > > I did not get an error when doing verbatim what the book says: > > > > > db.export_to_csv_file(open('somefile.csv', 'wb')) > > > > > but this only yielded one word in the target file, 'END' > > > > > Any idea what I should be looking at? > > > > > Thanks, > > > > Mart :) > >