[web2py] Re: mssql set identity_insert on

2019-12-20 Thread Davidiam
I agree that this is not good practice, but it is the only workable solution that we have found for multi pillar release. We are also heavily using roles, but here the problem is guaranteeing that users have the same ids on all pillars, otherwise we risk users belonging to the wrong groups in p

[web2py] Re: mssql set identity_insert on

2019-12-19 Thread Dave S
On Thursday, December 19, 2019 at 2:37:29 PM UTC-8, Davidiam wrote: > > As part of our release process, we need to insert records in the auth > tables using specific id's. On sqlite this is no problem, but in mssql we > get an error saying insert_identity is off. > The solution is to set inser

[web2py] Re: MSSQL connection

2016-12-22 Thread Willoughby
The official book is a good place to start - have you reviewed that yet? http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Dependencies On Wednesday, December 21, 2016 at 11:13:17 PM UTC-5, Steve Lyle wrote: > > Hi guys. > Newbie (of sorts) here. > 20+ years in programmi

[web2py] Re: MSSQL and auth.signature

2015-05-10 Thread Niphlod
this is a well-known "bug" . MSSQL doesn't support creating references with cascades that reference something else that cascades (i.e. only one is allowed). There's a workaround : it's all documented here : http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#MSSQL--Micr

[web2py] Re: MSSQL and auth.signature

2015-05-09 Thread Paolo Valleri
that's odd. Can you open an issue on github (https://github.com/web2py/pydal/issues) with a simple example to reproduce it? I'll have a look in the next few days Paolo On Saturday, May 9, 2015 at 11:54:30 AM UTC+2, Claudinei Fernandes wrote: > > Hi, > > Has anyone used "auth.signature" attribut

[web2py] Re: mssql connection URGENT!

2015-02-02 Thread Omi Chiba
Thanks! On Monday, February 2, 2015 at 3:06:05 PM UTC-6, Niphlod wrote: > > uhm. Technically having more than one instance of mssql running on the > same ip is possible (multiple named instances) but it involves a totally > different connection handshake. > If you don't specify different port n

[web2py] Re: mssql connection URGENT!

2015-02-02 Thread Niphlod
uhm. Technically having more than one instance of mssql running on the same ip is possible (multiple named instances) but it involves a totally different connection handshake. If you don't specify different port numbers, you can still have them "dynamic" but you have to resort to have SQL Serve

[web2py] Re: mssql connection URGENT!

2015-02-02 Thread Omi Chiba
Thank you for the reply. I found that that problem was why it doesn't accept IP Address instead of Named Instance and fixed the SQL Server configuration to use static IP to connect SQL Server. I can't connect to my servers SQL database via an IP Address http://dba.stackexchange.com/questions/62

[web2py] Re: mssql connection URGENT!

2015-02-02 Thread Massimo Di Pierro
The problem is that since you did not specify a name for the .table files you get default (nobody does). default is a hash of the db uri so if you change it the .table files break. If this is just a change in the name but the tables are already in the database, the you should enable a fake_migr

[web2py] Re: mssql legacy tables reference

2014-10-10 Thread Alen Cerovic
it WORKS now :-) I was playing with it and suddenly it is OK. I dont know what it was, I believe " vs ' these are working definitions: db.define_table("Mjesta", Field ("PostanskiBroj", "integer",notnull=True,unique=True), Field

[web2py] Re: mssql legacy tables reference

2014-10-03 Thread Niphlod
what if you don't use requires=IS_EMPTY() ? On Friday, October 3, 2014 8:52:12 AM UTC+2, Alen Cerovic wrote: > > is there any resolution to this, any ideas, or are there plans to make it > work in future? > > Dana ponedjeljak, 29. rujna 2014. 12:26:11 UTC+2, korisnik Alen Cerovic > napisao je: >

[web2py] Re: mssql legacy tables reference

2014-10-03 Thread Alen Cerovic
is there any resolution to this, any ideas, or are there plans to make it work in future? Dana ponedjeljak, 29. rujna 2014. 12:26:11 UTC+2, korisnik Alen Cerovic napisao je: > > Hi pn, I am expecting dropdown list of Mjesta when I add/edit record in > Partneri > tried putting 'requires' Field

[web2py] Re: mssql legacy tables reference

2014-09-29 Thread Alen Cerovic
Hi pn, I am expecting dropdown list of Mjesta when I add/edit record in Partneri tried putting 'requires' Field ('Mjesto','reference Mjesta.PostanskiBroj',requires=IS_NOT_EMPTY *()) *but n

[web2py] Re: mssql legacy tables reference

2014-09-28 Thread Tim Richardson
I just asked if the primary key is integer yet the answer was in front of me, except I don't know if it is an identity field. Because your primary key may look like a standard web2py id field, perhaps you can use the 'id' parameter instead of 'primarykey' -- Resources: - http://web2py.com - ht

[web2py] Re: mssql legacy tables reference

2014-09-28 Thread Tim Richardson
Is the legacy primary key an integer or even better an auto - incrementing integer? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this mes

[web2py] Re: mssql legacy tables reference

2014-09-28 Thread pn
Can you provide some clarification on what behavior are you expecting but not seeing when you create the reference? For example, are you able to create entries in the 'Partneri' table that refer keys not in the 'Mjesta' table? A quick workaround would be to put in a 'requires' lambda into the f

[web2py] Re: mssql legacy tables reference

2014-09-27 Thread Alen Cerovic
tried 'reference Mjesta' - no error but also nothing happens 'reference PostanskiBroj' - Query Not Supported: 'DAL' object has no attribute 'PostanskiBroj' I did not dive in source code but is it difficult to make references between legacy tables reliable. From my perspective it is very importan

[web2py] Re: mssql legacy tables reference

2014-09-26 Thread Massimo Di Pierro
'reference Mjesta.PostanskiBroj'* should be *'reference PostanskiBroj' *but I would not swear by references for legacy keyed tables.* On Thursday, 25 September 2014 11:58:21 UTC-5, Alen Cerovic wrote: > > Hi, > > I am totaly new to web2py, actually started yesterday :) > I am trying to work with

[web2py] Re: mssql connection

2013-11-14 Thread Cacpacific O
Thank you... / will try & feedback .. :) On Thursday, November 14, 2013 5:14:12 AM UTC+7, Derek wrote: > > Possible... > > Microsoft OLE DB Provider for ODBC Drivers error '80004005' > [Microsoft][ODBC Driver Manager]Data source name not found and no default > driver specified. > This usually

[web2py] Re: mssql connection

2013-11-13 Thread Derek
Regardless, it's the same message just a different driver manager. I'd say one of the settings being passed just won't work for mssql express, i'd guess 'pooling'. On Wednesday, November 13, 2013 3:25:38 PM UTC-7, Niphlod wrote: > > @derek: except that he's using unixodbc ^_^ > > Anyway, goo

[web2py] Re: mssql connection

2013-11-13 Thread Niphlod
@derek: except that he's using unixodbc ^_^ Anyway, googling "[unixODBC][Driver Manager]Data source name not found" leads you to several hundreds blogposts on the matter. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source co

[web2py] Re: mssql connection

2013-11-13 Thread Derek
Possible... Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Driver Manager]Data source name not found and no default driver specified. This usually happens in one of the following scenarios: - you referenced your connection incorrectly (e.g. spelled the DSN n

[web2py] Re: mssql connection

2013-11-12 Thread Cacpacific O
Hello Tim, Thank you for sharing. I've try as your advice but it still return error message as follow, I think something wrong with my odbc setup somehow. :) db = DAL('mssql://UserName:Password@203.150.29.227\SQLExpress/myDatabase', lazy_tables=True, pool_size=10) RuntimeError: Failure to con

[web2py] Re: mssql connection

2013-11-12 Thread Tim Richardson
Here is a working example using server authentication on a server called win2003, with a sqlserver instance name hcnsql07 and connecting to a database called hcn using default ports (I've added a couple of other parameters for performance. Investigate lazy_tables, it makes a huge difference. )

[web2py] Re: MSSQL connection error

2013-07-19 Thread greenpoise
Got it with FreeTDS. Thanks On Thursday, July 18, 2013 5:26:33 PM UTC-7, Niphlod wrote: > > plenty of references around the web it's a PITA to connect to MSSQL > from a linux "client" but take advices even related to other programming > languages to fix the odbc driver "bugs" and "intric

[web2py] Re: MSSQL connection error

2013-07-18 Thread greenpoise
the best answer to that threat is freetds which I actually have had success from Linux but is it supported by web2py? On Thursday, July 18, 2013 5:26:33 PM UTC-7, Niphlod wrote: > > plenty of references around the web it's a PITA to connect to MSSQL > from a linux "client" but take advices

[web2py] Re: MSSQL connection error

2013-07-18 Thread greenpoise
will try. Thanks!!! On Thursday, July 18, 2013 3:30:09 PM UTC-7, Marcio Andrey Oliveira wrote: > > Hi. > > I have no experience with web2py but it seems it's not able to read some > file. > > Try to use strace command to determine what file is missing then you can > search on the net which pa

[web2py] Re: MSSQL connection error

2013-07-18 Thread Niphlod
plenty of references around the web it's a PITA to connect to MSSQL from a linux "client" but take advices even related to other programming languages to fix the odbc driver "bugs" and "intricacies", like http://stackoverflow.com/questions/10728290/mssql-servers-native-odbc-driver-for-linux-

[web2py] Re: MSSQL connection error

2013-07-18 Thread Marcio Andrey Oliveira
Hi. I have no experience with web2py but it seems it's not able to read some file. Try to use strace command to determine what file is missing then you can search on the net which package contains the missing file. You can try something like strace -o output.txt or strace -p -o output.t

[web2py] Re: MSSQL

2013-03-15 Thread Massimo Di Pierro
I think this is fixed and closed the ticket but can you please double check? On Thursday, 14 March 2013 01:41:25 UTC-5, Marian wrote: > > Issues created: > > http://code.google.com/p/web2py/issues/detail?id=1390&sort=-id > > > Am Donnerstag, 14. März 2013 00:10:16 UTC+1 schrieb Niphlod: >> >> can

[web2py] Re: MSSQL

2013-03-13 Thread Marian
Issues created: http://code.google.com/p/web2py/issues/detail?id=1390&sort=-id Am Donnerstag, 14. März 2013 00:10:16 UTC+1 schrieb Niphlod: > > can you please open an issue about this so it gets tracked ? > > On Wednesday, March 13, 2013 9:39:21 PM UTC+1, Derek wrote: >> >> As far as compatibili

[web2py] Re: MSSQL

2013-03-13 Thread Niphlod
can you please open an issue about this so it gets tracked ? On Wednesday, March 13, 2013 9:39:21 PM UTC+1, Derek wrote: > > As far as compatibility issues, sqlite, mysql, and postgres all support > ISO8601 with an optional T. > > On Wednesday, March 13, 2013 1:28:30 PM UTC-7, Marian wrote: >> >>

[web2py] Re: MSSQL

2013-03-13 Thread Derek
As far as compatibility issues, sqlite, mysql, and postgres all support ISO8601 with an optional T. On Wednesday, March 13, 2013 1:28:30 PM UTC-7, Marian wrote: > > ISO 8601 format seems to be a better format, at least for mssql. Patching > this maybe can lead to compatibility issues. I don't kn

[web2py] Re: MSSQL

2013-03-13 Thread Derek
Ok, this page may explain what's going on... http://msdn.microsoft.com/en-us/library/ms180878(v=sql.100).aspx For ANSI SQL date format, it IS DATEFORMAT dependent (we're using a datetime not datetime2) and for 8601 it is NOT DATEFORMAT dependant. MSSQL only recognizes the "T" containing one as

[web2py] Re: MSSQL

2013-03-13 Thread Marian
ISO 8601 format seems to be a better format, at least for mssql. Patching this maybe can lead to compatibility issues. I don't know. :( -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emai

[web2py] Re: MSSQL

2013-03-13 Thread Derek
I don't see any reason why the base adapter can't use the ISO 8601 format with a 'T' in it. On Wednesday, March 13, 2013 1:08:23 PM UTC-7, Marian wrote: > > This seems to be ANSI SQL format, which seems to be not language neutral > > http://www.karaszi.com/sqlserver/info_datetime.asp > > -- -

[web2py] Re: MSSQL

2013-03-13 Thread Marian
This seems to be ANSI SQL format, which seems to be not language neutral http://www.karaszi.com/sqlserver/info_datetime.asp -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it,

[web2py] Re: MSSQL

2013-03-13 Thread Marian
The query is something like this: '2013-03-13 20:59:25' -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more optio

[web2py] Re: MSSQL

2013-03-13 Thread Derek
Do a trace and see what's actually being passed into that query. On Wednesday, March 13, 2013 12:45:35 PM UTC-7, Marian wrote: > > import pyodbc > import datetime > > cnxn = pyodbc.connect('DRIVER={SQL Server Native Client > 10.0};SERVER=barney;DATABASE=imagecontest_dev;UID=imagecontest2013;PWD=i

[web2py] Re: MSSQL

2013-03-13 Thread Marian
import pyodbc import datetime cnxn = pyodbc.connect('DRIVER={SQL Server Native Client 10.0};SERVER=barney;DATABASE=imagecontest_dev;UID=imagecontest2013;PWD=imagecontest2013' ) cursor = cnxn.cursor() now = datetime.datetime(2013, 3, 13, 16, 46, 4, 117000).isoformat()[:19]. replace('T',' ') cu

[web2py] Re: MSSQL

2013-03-13 Thread Marian
Ok that was a good hind. working directly with pyodbc: Working: now = datetime.datetime(2013, 3, 12, 16, 46, 4, 117000).isoformat()[:19].replace('T',' ') Not working: now = datetime.datetime(2013, 3, 13, 16, 46, 4, 117000).isoformat()[:19].replace('T',' ') -- --- You received this message b

[web2py] Re: MSSQL

2013-03-13 Thread Derek
Looks like line 1447 in DAL.py is to blame. if isinstance(obj, datetime.datetime): obj = obj.isoformat()[:19].replace('T',' ') should be: obj = obj.isoformat()[:19] That will preserve the 'T' If you don't need the 'T' (hey, why strip it if it works?) You should do th

[web2py] Re: MSSQL

2013-03-13 Thread Derek
It probably worked yesterday because yesterday was 3-12 which could be interpreted as December 3rd or March 12th. 3-13 can only be interpreted as march 2013, so perhaps it was reading the date incorrectly? On Wednesday, March 13, 2013 9:16:26 AM UTC-7, Marian wrote: > > Yes this fails, this is r

[web2py] Re: MSSQL

2013-03-13 Thread Marian
I did a patch in the MSSQLAdapter.represent function. This is the only format working for me. But it is obviously not a good way to implement an own dateformat. elif fieldtype == 'datetime': if isinstance(obj, datetime.datetime): obj = obj.isoformat()[:19]

[web2py] Re: MSSQL

2013-03-13 Thread Marian
Yes this fails, this is really strange. As said it worked yesterday and it's not a local database server which I restarted or something like that. -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop rec

[web2py] Re: MSSQL

2013-03-13 Thread Niphlod
ok. seems that -MM-DD HH:MM:SS is somewhat unrecognizeable by your databasethis is strange because that representation should be "universally valid". Let's try with a more specific (just to nail it) now = '2013-03-13 16:46:04' and see if the issue is the same On Wednesday, March 13

[web2py] Re: MSSQL

2013-03-13 Thread Marian
Maybe this helps from the web2py error ticket: (self=, table=, fields=[(, 'auth'), (, datetime.datetime(2013, 3, 13, 16, 46, 4, 117000)), (, '192.168.77.4'), (, 1), (, 'User 1 Logged-in')]) -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group

[web2py] Re: MSSQL

2013-03-13 Thread Marian
That's why I appreciate your help :) Now there's the DataError: Traceback (most recent call last): File "D:\Temp\test_pyodbc.py", line 9, in cursor.execute("insert into auth_event(time_stamp, client_ip, origin, description) values (?, ?, ?, ?)", now, '192.0.0.1', 'origin', 'description' )

[web2py] Re: MSSQL

2013-03-13 Thread Niphlod
remote testing makes me sick :P another trial. now = datetime.datetime.now().isoformat()[:19].replace('T',' ') On Wednesday, March 13, 2013 4:39:30 PM UTC+1, Marian wrote: > > This works also > -- --- You received this message because you are subscribed to the Google Groups "web2py-users" gr

[web2py] Re: MSSQL

2013-03-13 Thread Marian
This works also -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/grou

[web2py] Re: MSSQL

2013-03-13 Thread Niphlod
what about using now = datetime.datetime.now() ? On Wednesday, March 13, 2013 4:28:03 PM UTC+1, Marian wrote: > > Ok I did a quick test and this time it worked: > > import pyodbc > import datetime > > cnxn = pyodbc.connect('DRIVER={SQL Server Native Client > 10.0};SERVER=host;DATABASE=db;UID=user

[web2py] Re: MSSQL

2013-03-13 Thread Marian
Ok I did a quick test and this time it worked: import pyodbc import datetime cnxn = pyodbc.connect('DRIVER={SQL Server Native Client 10.0};SERVER=host;DATABASE=db;UID=user;PWD=pw') cursor = cnxn.cursor() now = datetime.datetime(2013, 3, 13, 15, 2, 9) cursor.execute("insert into auth_event(time

[web2py] Re: MSSQL

2013-03-13 Thread Niphlod
the issue is that it seems that the adapter can't "adapt" the datetime object to the necessary buffer of commands that are needed to ship to mssql. If you have time you can help testing if connecting outside the DAL the insert works ... cnxn = pyodbc.connect() .. etc etc etc I don't have a py

[web2py] Re: MSSQL

2013-03-13 Thread Marian
Oh no thank you for your help. :) The user language is german and encoding of the database is Latin1_General_CI_AS. -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an

[web2py] Re: MSSQL

2013-03-13 Thread Niphlod
I could have answered seeing the message... supposedly German ? On Wednesday, March 13, 2013 3:36:21 PM UTC+1, Niphlod wrote: > > something on the adapter side is terribly wrong... what's the default > language of the user connecting to this instance ? > > PS: thanks for the patience. > > On Wedn

[web2py] Re: MSSQL

2013-03-13 Thread Niphlod
something on the adapter side is terribly wrong... what's the default language of the user connecting to this instance ? PS: thanks for the patience. On Wednesday, March 13, 2013 3:29:51 PM UTC+1, Marian wrote: > > Event with odbc syntax it fails like this: > > >>> import datetime > >>> now = da

[web2py] Re: MSSQL

2013-03-13 Thread Marian
Event with odbc syntax it fails like this: >>> import datetime >>> now = datetime.datetime(2013, 3, 13, 15, 2, 9) >>> db.auth_event.insert(client_ip='bogus', time_stamp=now) Traceback (most recent call last): File "", line 1, in File "D:\web2py\gluon\dal.py", line 8443, in insert ret = s

[web2py] Re: MSSQL

2013-03-13 Thread Niphlod
ok... one more trial. import datetime now = datetime.datetime(2013, 3, 13, 15, 2, 9) db.auth_event.insert(client_ip='bogus', time_stamp=now) and . did you try connecting to the database using the odbc syntax ? db = DAL('mssql://Driver={SQL Server Native Client 10.0};Server=myServerAddres

[web2py] Re: MSSQL

2013-03-13 Thread Marian
The databse driver is pyodbc-3.0.6-py2.7 -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https

[web2py] Re: MSSQL

2013-03-13 Thread Marian
I am running on Windows 7 Ent. 64, with Python 2.7.2 x64 as you also can see in the log. It seems it fails even if I do not insert a timestamp. Created by Massimo Di Pierro, Copyright 2007-2013 Version 2.4.4-stable+timestamp.2013.03.11.20.32.00 Database drivers available: SQLite(sqlite3), MySQL

[web2py] Re: MSSQL

2013-03-13 Thread Niphlod
ok, next step. Are you on windows ? what driver have you available for mssql ? (you can see as soon as you start web2py.py in the console) next step: open a shell (web2py.py -M -S theappname) and do (or try to do) auth.log_event('something') db.commit() db.auth_event.insert(client_ip='bogus', use

[web2py] Re: MSSQL

2013-03-13 Thread Marian
Ah ok sorry. The structure is like this: id (PS, int, NOT NULL) time_stamp (datetime, NULL) client_ip (varchar(512), NULL) user_id (FS, int, NULL) origin (varchar(512), NULL) description (text, NULL) -- --- You received this message because you are subscribed to the Google Groups "web2py-users

[web2py] Re: MSSQL

2013-03-13 Thread Niphlod
I was asking for the actual structure of the auth_event table on the database On Wednesday, March 13, 2013 2:21:51 PM UTC+1, Marian wrote: > > The connection string is: > mssql://USER:PASSWORD@HOST/DATABASE > > The auth_events table is the build in table of auth. I did not customize > it but

[web2py] Re: MSSQL

2013-03-13 Thread Marian
The connection string is: mssql://USER:PASSWORD@HOST/DATABASE The auth_events table is the build in table of auth. I did not customize it but I customized auth_user. auth.settings.extra_fields['auth_user']=[ Field('image', 'upload', default='', autodelete=True, requires=IS_EMPTY_OR(IS_IMAGE

[web2py] Re: MSSQL

2013-03-13 Thread Niphlod
seems a casting error: what is the definition on the database of your auth_events table as stored in the database ? what is your connection string ? On Wednesday, March 13, 2013 1:46:43 PM UTC+1, Marian wrote: > > Somehow my web2py is not working with my mssql database anymore. I am > pretty sur

[web2py] Re: MSSQL datetime conversion issue

2013-01-16 Thread Niphlod
did you try those on a fresh app and a fresh database ? Those issue never rise if tables and values are managed by web2py, they only show up with wrong migrations, legacy tables, etc . I use datetime fields and MSSQL2008 with no issues at all. Il giorno mercoledì 16 gennaio 2013 13:26:45 UTC+1,

[web2py] Re: MSSQL How to access tables which not created by web2py

2012-01-18 Thread Dan
Cool, How can i forgot the executesql! thank you very much!!! On Jan 18, 4:19 pm, Bruno Rocha wrote: > So you can use: > > results = msdb.execute_sql("SELECT * FROM table.") > > -- > > Bruno Rocha > [http://rochacbruno.com.br]

Re: [web2py] Re: MSSQL How to access tables which not created by web2py

2012-01-18 Thread Bruno Rocha
So you can use: results = msdb.execute_sql("SELECT * FROM table.") -- Bruno Rocha [http://rochacbruno.com.br]

[web2py] Re: MSSQL How to access tables which not created by web2py

2012-01-18 Thread Dan
Thanks a lot, Bruno. That really helps, but since my legacy DBs are too much and too complex (MSSQL Server are only readable to me), I decide to create my own connections and queries to my MSSQL Server. Thanks again. On Jan 18, 3:57 pm, Bruno Rocha wrote: > You need to map the existent table and

[web2py] Re: mssql connect

2011-09-01 Thread Brian M
Glad you got it working! :)

[web2py] Re: mssql connect

2011-09-01 Thread patrick moon
Brian: You're the man...said the right thing. I didn't know pyodbc did not ship with web2py. Download and dropped it in the same folder as web2py (don't know if this was mentioned in doc.) Works like a beauty. Thanks all again. On Aug 31, 7:36 pm, Brian M wrote: > What version of python are yo

[web2py] Re: mssql connect

2011-08-31 Thread Brian M
What version of python are you using? Have you installed the matching pyodbc version from http://code.google.com/p/pyodbc/? ~Brian

[web2py] Re: mssql connect

2011-08-31 Thread patrick moon
I tried to run from the source but this is what I get. Module use of python25.dll conflicts with this version of Python. Is there a way around this? Thanks On Aug 31, 12:14 pm, Willoughby wrote: > Also check to make sure it's loading the MSSQL database driver. > You have to run from source, th

[web2py] Re: mssql connect

2011-08-31 Thread Omi Chiba
Additonal to Denes, I'm using Microsoft SQL Server 2008 Express and successfully connection with this. db = DAL("mssql://UserID:Password@ComputerName\SQLEXPRESS/ DatabaseName") On Aug 31, 1:52 pm, DenesL wrote: > The connection string seems ok but: > - check user and password > - leave out the

[web2py] Re: mssql connect

2011-08-31 Thread Willoughby
Also check to make sure it's loading the MSSQL database driver. You have to run from source, the binary doesn't have it: http://www.web2py.com/book/default/chapter/06#Dependencies

[web2py] Re: mssql connect

2011-08-31 Thread DenesL
The connection string seems ok but: - check user and password - leave out the port (1433 is the default) - if yo are using the Express version add the instance name e.g. POPE\\SQLEXPRESS/xPAC On Aug 31, 2:25 pm, patrick moon wrote: > I'm using the doc suggested connection string: > > db =  DAL(

[web2py] Re: MSSQL DAL multiple cascade paths not allowed

2011-08-24 Thread Massimo Di Pierro
I would prefer to leave this as it is for backward compatibility reasons but you can do Field(, ondelete="no action") correct? In any case open an issue on google code. On Aug 17, 2:16 pm, Omi Chiba wrote: > I was fololwing the web2py book with mssql for my database. > > db.define_table('comm

[web2py] Re: MSSQL Field Name: file is not allowed

2011-08-16 Thread Anthony
On Tuesday, August 16, 2011 3:43:41 PM UTC-4, Omi Chiba wrote: > > I just want to share my experience which takes hours to figure out. I > was reading web2py book - 03 Overview - An Image Blog, it worked fine > with SQLite and tried to use mssql server on my local PC which is also > the new expe

[web2py] Re: MSSQL to CSV

2011-05-18 Thread DenesL
On May 18, 5:02 pm, Massimo Di Pierro wrote: > db.define_table('yourtable',Field(...),,migrate=True,fake_migrate=True) why not just ...,migrate=False) ? what does that combo provide?

[web2py] Re: MSSQL to CSV

2011-05-18 Thread mart
ok, got it! thanks again :) On May 18, 5:02 pm, Massimo Di Pierro wrote: > ERRATA: > > > > > > > > > db=DAL('mssql://...') > > db.define_table('yourtable',Field(...),,migrate=True,fake_migrate=True) > > print str(db(db.yourtable).select()) # outputs the CSV

[web2py] Re: MSSQL to CSV

2011-05-18 Thread Massimo Di Pierro
ERRATA: > db=DAL('mssql://...') > db.define_table('yourtable',Field(...),,migrate=True,fake_migrate=True) > print str(db(db.yourtable).select()) # outputs the CSV

[web2py] Re: MSSQL to CSV

2011-05-18 Thread mart
ok, that's sounds like a good idea (btw - dal is worth gold!) Thanks for the help Massimo! :) On May 18, 4:43 pm, Massimo Di Pierro wrote: > If you know the mssql table structure, you can create a quick web2py > model: > > db=DAL('mssql://...') > db.define_table('yourtable',Field(...),) > pr

[web2py] Re: MSSQL to CSV

2011-05-18 Thread Massimo Di Pierro
If you know the mssql table structure, you can create a quick web2py model: db=DAL('mssql://...') db.define_table('yourtable',Field(...),) print str(db(db.yourtable).select()) # outputs the CSV On May 18, 3:32 pm, mart wrote: > Hi, > > there's this MSSQL server running remotely, and I would

Re: [web2py] Re: MSSQL Connection error on MacOS

2011-03-31 Thread Ross Peoples
Glad you were able to figure it out.

Re: [web2py] Re: MSSQL Connection error on MacOS

2011-03-31 Thread Bruno Rocha
I solved the problem with HomeBrew brew install unixodbc brew install freetds after that you can set up your dsn in Utilities iODBC. Thank you. -- Bruno Rocha [ About me: http://zerp.ly/rochacbruno ] On Thu, Mar 31, 2011 at 10:39 AM, Ross Peoples wrote: > Bruno, > > I too have had this pro

[web2py] Re: MSSQL Connection error on MacOS

2011-03-31 Thread Ross Peoples
Bruno, I too have had this problem. It seems as if Mac OS X has some real problems connecting to MSSQL, which isn't too much of a surprise I guess. The way that I develop on Mac OS X may be crazy or over-complicated, but I find it works well for me: I set up a Ubuntu Server virtual machine in

[web2py] Re: MSSQL Connection error on MacOS

2011-03-29 Thread annet
Hi Bruno, I had the same problem using MySQLdb, I solved it by setting up a my.cnf file in /etc the following way: Log in to OS X using an administrator-level account, open Terminal; cd /usr/local/mysql/support-files/ sudo cp my-huge.cnf /etc/my.cnf and enter your admin password when prompted.

[web2py] Re: MSSQL Connection error on MacOS

2011-03-29 Thread Bruno Rocha
It seens someone are having same issue woth Pyodbc and sqlalchemy http://stackoverflow.com/questions/4665078/connect-to-mssql-from-sqlalchemy-by-pyodbc-on-mac-os So it is not web2py DAL issue, it is Pyodbc issue, anyone aware? On Tue, Mar 29, 2011 at 12:28 PM, Bruno Rocha wrote: > HI, > > I am

[web2py] Re: mssql, login problems

2011-03-05 Thread Stef Mientki
As it doesn't seem possible to change self._uri in SQLDB, I solved the problem by adding an extra keyword argument (which travels to SQLDB): Database_Name = r'mssql://NKCV2 *MSSQL_Login = ';UID=MY_SQL_LOGIN;PWD=MY_PASSWORD' *My_DB = DAL ( Database_Name, folder = folder, *MSSQL_Login =

[web2py] Re: MSSQL or MSSQL2

2011-03-01 Thread Massimo Di Pierro
I think so but I cannot say for sure. I am not expert on mssql. On Mar 1, 5:03 pm, Stef Mientki wrote: > On 14-02-2011 22:17, Massimo Di Pierro wrote:> The difference is subtle. > > as SQLserver uses utf-16, the size will double, > am I correct ? > > thanks, > Stef Mientki > > > > > > > > > mssql

Re: [web2py] Re: MSSQL or MSSQL2

2011-03-01 Thread Stef Mientki
On 14-02-2011 22:17, Massimo Di Pierro wrote: > The difference is subtle. as SQLserver uses utf-16, the size will double, am I correct ? thanks, Stef Mientki > mssql is the first version of the adapter, the one that everybody > uses. It stores data as UTF8 but in ascii. That means the length of >

[web2py] Re: MSSQL or MSSQL2

2011-02-14 Thread Ross Peoples
Thanks for the clarification. My existing database uses BIT fields, so I will be sticking to mssql for now. On Feb 14, 4:17 pm, Massimo Di Pierro wrote: > The difference is subtle. > > mssql is the first version of the adapter, the one that everybody > uses. It stores data as UTF8 but in ascii. T

[web2py] Re: MSSQL or MSSQL2

2011-02-14 Thread Massimo Di Pierro
The difference is subtle. mssql is the first version of the adapter, the one that everybody uses. It stores data as UTF8 but in ascii. That means the length of the fields is not the number of unicode chars but the length of the utf8 encoded chars. It also uses BIT for booleans. mssql2 uses unicod

[web2py] Re: MSSQL Select statements

2010-11-13 Thread Crim
Thanks DenesL ^ ^ On Nov 13, 3:57 pm, DenesL wrote: > > rows=db(db.user.email=...@b.com).select() > > that did not paste properly, should be > > rows=db(db.User.Email=="a...@b.com").select()

[web2py] Re: MSSQL Select statements

2010-11-13 Thread DenesL
> rows=db(db.user.email=...@b.com).select() that did not paste properly, should be rows=db(db.User.Email=="a...@b.com").select()

[web2py] Re: MSSQL Select statements

2010-11-13 Thread Crim
Brian, Thanks ^ ^ this i understand. Thanks for taking time and give me a great example! On Nov 13, 3:48 pm, Brian M wrote: > Crim, > > Yes, the criteria are any python variables you might like substituted > into your query. I probably shouldn't have used only 'strings' in my > example, sorry. >

[web2py] Re: MSSQL Select statements

2010-11-13 Thread DenesL
You have CREATE TABLE [User]( Email varchar(50), Name varchar(50), PIN int, Phone varchar(50), Address varchar(50), Mileage int, MealPref varchar(50), PRIMARY KEY (Email)); that translates into this web2py model db.define_table('User', Field('Email','string',50), Field('Name','string',50),

[web2py] Re: MSSQL Select statements

2010-11-13 Thread Brian M
Crim, Yes, the criteria are any python variables you might like substituted into your query. I probably shouldn't have used only 'strings' in my example, sorry. my_city = 'somewhere' my_state = 'MN' start_date = date(2010, 11, 13) end_date = date(2010, 11, 15) results = db.executesql("SELECT * FR

[web2py] Re: MSSQL Select statements

2010-11-13 Thread Crim
Ah thanks this i like too ^ ^ my only question on it is when you say: results = db.executesql("SELECT foo,bar FROM my_table WHERE blah = ? and something = ?" , ('criteria 1', 'criteria 2'), True) what do you mean by 'criteria 1' ... what kind of criteria? is that where i put a python bit of code

[web2py] Re: MSSQL Select statements

2010-11-13 Thread Crim
you can down load the sql code here http://www.megaupload.com/?d=ARORZKPF no i cant use it .. so i take it i have to define the table in web2py? thanks a lot for your help ^ ^ On Nov 13, 3:09 pm, DenesL wrote: > Hi Crim, > > if you can use db.user.email that means you have defined the table i

  1   2   >