var products = Product.GetPaged(1, 20);
error:
'ROW_NUMBER' ....
I don't think Subsonic supports paging for SQL Server 2000 (but I could be wrong). You'd need SQL Server 2005 or 2008.
I'm guessing Subsonic uses a CTE or the ROWNUMBER() syntax. These are not supported in SQL2000
Related
I have an C++ application using MFC CRecordset to add rows to a table of an SQLite database, using the free ODBC driver by Ch. Werner. For this, I use the usual sequence of rs.Open(), rs.AddNew(), set values, and finally rs.Update().
This works on a small example, but with my actual database rs.Update() fails with error -1 and the following error message: unrecognized token: ""RedFaktorFly" (1). The 'token' is a truncated name of column 14 of the table, whose full name is "RedFaktorFlyt".
In some runs, it appends seemingly random characters, so the message becomes for ex. unrecognized token: ""RedFaktorFlyH" (1).
Interestingly, when I add "LongNames=true" to the ODBC connection string, which prepends table names to the column names and therefore makes the SQL query longer, the error becomes (for ex.) unrecognized token: ""K_Noder.MaxKompresjox" (1) - where "MaxKompresjonsFaktor" is the name of column 10 of the table.
This seems to suggest that there is a limit on the length of a SQL query accepted by the driver - but it seems strange that such a limit would be so small that it would fail already with 14 columns.
I do not think that the limit is in the C++ part, since the same code works fine both with the (commercial) SQLite driver from Devart and with Microsoft's ODBC driver for Access.
I tried adding a TraceFile option to the ODBC connection string, but it does not seem to do anything, so I do not know what exactly gets sent to the ODBC driver.
I see the same behaviour both with 32- and 64-bit builds, using Visual Studio 2015 on Windows 10.
Any suggestions what to try next?
I'll give you a solution to solve your issue completely. I don't know if it's suitable for you, but definitely it works. I successfully use it on my own.
For any operation except listing records, use CDatabase, not CRecordset. So, to insert rows to any table, to update records, to delete records, use CDatabase. To retrieve records from SQLLite database, use CRecordset. I can give you examples if you need.
September update have changed how to consume data from Postgres.
M code will change to something like this:
Value.NativeQuery(PostgreSQL.Database("server", "db"), "query", null, [EnableFolding=true])
How can I change to function as before the update?
PostgreSQL.Database("server", "db", [Query="query"])
Or now I would need to do it manually?
Regards,
Finally Microsoft gave me the workarond: just remove [EnableFolding=true] from query, advance editor (the one showing the m language)
Right yesterday I went into the same issue.
Data refresh now works only from desktop while fails for any new query created with latest Power BI once published on service.
Tried to set EnableFolding=false and EnableFolding=none as error message suggests but both throwing a error.
I am trying to insert Persian string like "سلام" to SQL server 12 database with Poco ODBC. But in the database I see Characters like this "ط³ظ„ط§ظ…". the column data type is varchar(I try it with nvarchar too) and I test it with different Collation like Arabic_CI_AS and Persian_100_CI_AS.
there is no problem with data stored in the database. it is what I inserted into the database.
but when I try to see my database with Microsoft SQL Server Management Studio and another application with Qt interface, both of them show me "ط³ظ„ط§ظ…".
Does anyone have any idea how to fix it?
std::string updated = "سلام";
Statement select(session);
select << "INSERT INTO Employee VALUES( ?)",
use(updated),now;
Please change 'سلام' to N'سلام'
i'm trying to query a table with c++ odbc using 'sql driver'.
While i'm trying to open the table using my query i get 'Data truncated.' error. I checked it out, the data i'm passing for that query is no longer than 255 in length, i think it is a bug.
did some one solved that issue? any suggestions?
windows 7, sql server 2008, vs 2010.
Thanks in advance.
the fix up
check not only the parameter you pass during open but also the fields that are being transferred during DoFieldExchange() function, in my case that was another record field that was transferred to me from the sql and messed things up.
refer the link for the fix up.
I use QSqlDatabase to connect to remote MSSQL Server, but it seem the speed very slow. With a same query (the result is about 20 rows), i tried in MSSQL Management 2008 take about 1s but in my application (use QSqlDatabase) it take nearly 8s, Anybody explain me why this happen?
I found that setting setForward(true) and preparing your SQL statements drastically improves performance of SELECT based SQL queries. If setForward(true) is not called, Qt will attempt to loop through the entire result set while querying the database which causes slow downs.