App crash MSSQLServerPlugin.dll

Hi. I have a small windows app written in Real Studio 2012r2 which crashes when trying to select a record from SQL Server 2008 remote database.
I am using MSSQLServerDatabase with db.SQLSelect(). The sql statement is good and works fine using sql server management studio on the remote sever.

The table has 19 cols. If I use select col1,col2…col19 From table where…col1=123 and I leave out two of the columns it works fine and the data is good.
The two columns that give the problem are defined as Field (varchar(max),notnull).

If I just select one of the above two cols on its own the RS is returned without error. However on looking at the data in the debugger it is rubish and looks like.
“ㄠ瑳䴠湩⵩楲杮焠慵瑲牥㔠簠䤠灭牯整⁤牦浯䈠汥扬慯摲攠瑮祲†㑐㘴㘹缲ǚÄǚ譵⻒㭬ࠀ” .
The actual data on disk is good.

The app crash message is as follows.

Problem signature:
Problem Event Name: APPCRASH
Application Name: DebugMy Application.exe
Application Version: 1.0.0.0
Application Timestamp: 50be1953
Fault Module Name: MSSQLServerPlugin.dll
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 50be1507
Exception Code: c0000005
Exception Offset: 00007d5e
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 2057
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt

Is there a later version the MSSQLServerPlugin.dll that I could try?
Incidentally, I can insert new records into this table (all 19 fields worth) without any problems.

Thanks in adavance for any suggestions

did you try with Xojo?

what data types do columns have?
Maybe some data type the older version of the plugin didn’t know about?

I have not tried it in Xojo. Can I download a trial version?
The data type are Field (varchar(max),notnull).

just use the trial.

or switch to MBS SQL Plugin.

A bug in the MS SQL native client
https://connect.microsoft.com/SQLServer/feedback/details/467300/problem-with-varchar-max-via-sql-native-client

Basically don’t use varchar(max) :slight_smile:

I’ve also had issues with this and it isn’t a XOJO problem it is a Microsoft problem. There are also some work arounds in the link that Norman posted.

You could also just use the ODBC Plugin if you can’t get around the varchar(max).

Thank you for your replies.

I am stuck with the varchar(max) as the large database is used by a production web server. Will the ODBC Plugin solve my problem as I will not be able to change the field type? Would I have the same problem if I used an aspx script or vb.net?

you can cast in the queries to other field type.

[quote=174277:@David Simpson]Thank you for your replies.

I am stuck with the varchar(max) as the large database is used by a production web server. Will the ODBC Plugin solve my problem as I will not be able to change the field type? Would I have the same problem if I used an aspx script or vb.net?[/quote]
Make sure you are using the latest version of the mssql client library on your computer. Newer versions don’t have this problem.

I have installed the latestest version of Windows power shell extensions for SQL server 2008 and I still have the same problem.
Could anyone point me at the ODBC connection string to connect to a sql server 2008

you could try MBS SQL Plugin which can connect with various ways including ODBC general, or Microsoft SQL Server via native, ODBC, OLE-DB or DB-Library.

[quote=174281:@Christian Schmitz]Christian Schmitz

you can cast in the queries to other field type.[/quote]

I will certainly give it a try.