SDAC And .Net
-
- Posts: 52
- Joined: Mon 24 Mar 2008 13:22
SDAC And .Net
I have replaced in old dll-program ADODB by SDAC. Its working with TMSConnection, TMSQuery components. Uses Devart.SDAC.MSAccess, Devart.SDAC.OleDBAccess, Devart.DAC.DBAccess, Devart.Dac.Memdata and DB.
The library has not compiled for now, issuing an error "File not found: System.Drawing.Imaging.dcuil".
Returning to back on TADOQuery the problem disappears.
SDAC 4.80.57, RAD Studio 2007 Delphi .Net.
The library has not compiled for now, issuing an error "File not found: System.Drawing.Imaging.dcuil".
Returning to back on TADOQuery the problem disappears.
SDAC 4.80.57, RAD Studio 2007 Delphi .Net.
-
- Posts: 52
- Joined: Mon 24 Mar 2008 13:22
Oh, sample is small:
it is all. I uncomment "Devart.SDAC.MSAccess" and I have a compiler error "File not found...".
Code: Select all
{$A-,B-,C+,D-,E-,F-,G+,H+,I+,J+,K-,L-,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y-,Z1}
{$MINSTACKSIZE $00001000}
{$MAXSTACKSIZE $00100000}
{$IMAGEBASE $00400000}
{$APPTYPE GUI}
{$WARN SYMBOL_DEPRECATED ON}
{$WARN SYMBOL_LIBRARY ON}
{$WARN SYMBOL_PLATFORM ON}
{$WARN SYMBOL_EXPERIMENTAL ON}
{$WARN UNIT_LIBRARY ON}
{$WARN UNIT_PLATFORM ON}
{$WARN UNIT_DEPRECATED ON}
{$WARN UNIT_EXPERIMENTAL ON}
{$WARN HRESULT_COMPAT ON}
{$WARN HIDING_MEMBER ON}
{$WARN HIDDEN_VIRTUAL ON}
{$WARN GARBAGE ON}
{$WARN BOUNDS_ERROR ON}
{$WARN ZERO_NIL_COMPAT ON}
{$WARN STRING_CONST_TRUNCED ON}
{$WARN FOR_LOOP_VAR_VARPAR ON}
{$WARN TYPED_CONST_VARPAR ON}
{$WARN ASG_TO_TYPED_CONST ON}
{$WARN CASE_LABEL_RANGE ON}
{$WARN FOR_VARIABLE ON}
{$WARN CONSTRUCTING_ABSTRACT ON}
{$WARN COMPARISON_FALSE ON}
{$WARN COMPARISON_TRUE ON}
{$WARN COMPARING_SIGNED_UNSIGNED ON}
{$WARN COMBINING_SIGNED_UNSIGNED ON}
{$WARN UNSUPPORTED_CONSTRUCT ON}
{$WARN FILE_OPEN ON}
{$WARN FILE_OPEN_UNITSRC ON}
{$WARN BAD_GLOBAL_SYMBOL ON}
{$WARN DUPLICATE_CTOR_DTOR ON}
{$WARN INVALID_DIRECTIVE ON}
{$WARN PACKAGE_NO_LINK ON}
{$WARN PACKAGED_THREADVAR ON}
{$WARN IMPLICIT_IMPORT ON}
{$WARN HPPEMIT_IGNORED ON}
{$WARN NO_RETVAL ON}
{$WARN USE_BEFORE_DEF ON}
{$WARN FOR_LOOP_VAR_UNDEF ON}
{$WARN UNIT_NAME_MISMATCH ON}
{$WARN NO_CFG_FILE_FOUND ON}
{$WARN IMPLICIT_VARIANTS ON}
{$WARN UNICODE_TO_LOCALE ON}
{$WARN LOCALE_TO_UNICODE ON}
{$WARN IMAGEBASE_MULTIPLE ON}
{$WARN SUSPICIOUS_TYPECAST ON}
{$WARN PRIVATE_PROPACCESSOR ON}
{$WARN UNSAFE_TYPE ON}
{$WARN UNSAFE_CODE ON}
{$WARN UNSAFE_CAST ON}
{$WARN OPTION_TRUNCATED ON}
{$WARN WIDECHAR_REDUCED ON}
{$WARN DUPLICATES_IGNORED ON}
{$WARN UNIT_INIT_SEQ ON}
{$WARN LOCAL_PINVOKE ON}
{$WARN MESSAGE_DIRECTIVE ON}
{$WARN TYPEINFO_IMPLICITLY_ADDED ON}
{$WARN XML_WHITESPACE_NOT_ALLOWED ON}
{$WARN XML_UNKNOWN_ENTITY ON}
{$WARN XML_INVALID_NAME_START ON}
{$WARN XML_INVALID_NAME ON}
{$WARN XML_EXPECTED_CHARACTER ON}
{$WARN XML_CREF_NO_RESOLVE ON}
{$WARN XML_NO_PARM ON}
{$WARN XML_NO_MATCHING_PARM ON}
library Library1;
uses
SysUtils,
Classes,
System.Reflection,
Devart.SDAC.MSAccess,
System.Runtime.InteropServices;
[assembly: AssemblyTitle('')]
[assembly: AssemblyDescription('')]
[assembly: AssemblyConfiguration('')]
[assembly: AssemblyCompany('')]
[assembly: AssemblyProduct('')]
[assembly: AssemblyCopyright('')]
[assembly: AssemblyTrademark('')]
[assembly: AssemblyCulture('')]
[assembly: AssemblyVersion('1.0.*')]
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile('')]
[assembly: AssemblyKeyName('')]
[assembly: ComVisible(False)]
type
TDistancer = class
end;
begin
end.
-
- Posts: 52
- Joined: Mon 24 Mar 2008 13:22
Uh, there is a new trouble with this sdac & .Net dll. If dll is builded for any cpu or x64 for Windows 2008 Server x64 (for x86 on x86 platform works correctly), host wich uses dll gets exceptions:Dimon wrote:To solve the problem you should add the System.Drawing.dll library to the project references.
Code: Select all
[OverflowException: Arithmetic operation resulted in an overflow.]
Devart.Sdac.Units.OLEDBAccess.@851OLEDBAccess$InitDataSourceTypes$AddType($Unnamed113& $frame_InitDataSourceTypes, String TypeName) +365
Devart.Sdac.Units.OLEDBAccess.InitDataSourceTypes() +233
Devart.Sdac.Units.OLEDBAccess.Devart.Sdac.OLEDBAccess() +45
[TypeInitializationException: The type initializer for 'Devart.Sdac.Units.OLEDBAccess' threw an exception.]
System.Runtime.CompilerServices.RuntimeHelpers._RunClassConstructor(IntPtr type) +0
System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(RuntimeTypeHandle type) +22
Devart.Sdac.Units.MSAccess..cctor() +161
[TypeInitializationException: The type initializer for 'Devart.Sdac.Units.MSAccess' threw an exception.]
System.Runtime.CompilerServices.RuntimeHelpers._RunClassConstructor(IntPtr type) +0
System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(RuntimeTypeHandle type) +22
In sample test added constructor with
Code: Select all
Connection:=TMSConnection.Create(nil);
Connection.ConnectString:=aConnStr;
Connection.KeepConnection:=false;
Connection.LoginPrompt:=false;
Connection.ConnectionTimeout:=600;
Connection.Options.KeepDesignConnected:=false;
Connection.Options.MultipleActiveResultSets:=true;
Connection.Options.DefaultSortType:=stCaseInsensitive;
Connection.Options.PacketSize:=8192;
Connection.Options.DefaultLockTimeout:=30000;
MSQuery:=TMSQuery.Create(nil);
MSQuery.Connection:=Connection;
MSQuery.SQL.Text:='SELECT * FROM TestTable';
MSQuery.Open -- this string raises exception 'arythmetic overflow...'
Hi there,
We are having the same problem above running a .NET app on windows server 2008r2 (64-bit) and was happy to see this post, but then sad to see there was no resolution on here!
I presume you were able to solve the issue and advised this person by email, but could you post the resolution as well for others who then have the same problem?
Regards,
We are having the same problem above running a .NET app on windows server 2008r2 (64-bit) and was happy to see this post, but then sad to see there was no resolution on here!
I presume you were able to solve the issue and advised this person by email, but could you post the resolution as well for others who then have the same problem?
Regards,