D
DraguVaso
Hi,
I have to do some actions with the tables and query's of some
Access-Databases. The following code works for most of the Access-Databases,
but unfortunately not for all!
In some case it gives me an error, and it's always with the same
Access-database I got eveytime that error: With these Access-database it
'thinks' there aren't any Tables or Procedures in it (but there are a lot of
them in the Database)
When I looked more closely to it it gace me an exception:
"System.Runtime.InteropServices.COMException (0x80010105): The server threw
an exception."
I runned the folowwing code:
Dim ADOConnection As New ADODB.Connection
Dim cat As New ADOX.Catalog
SyncLock (GetType(clsDB))
Try
ADOConnection.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & strDirFile)
cat.ActiveConnection = ADOConnection
Try
MessageBox.Show(cat.Tables.Count)
-> On the cat.Tables.Count I got the error.
?cat.Tables.Count
<error: an exception of type: {System.Runtime.InteropServices.COMException}
occurred>
More info about the error:
?ex.tostring
"System.Runtime.InteropServices.COMException (0x80010105): The server threw
an exception.
at ADOX.Tables.get_Count()
at RefreshODBC.clsDB.subRefresh() in C:\VB NET\RefreshODBC\clsDB.vb:line
29"
?ex.gettype
{System.RuntimeType}
[System.RuntimeType]: {System.RuntimeType}
Assembly: {System.Reflection.Assembly}
AssemblyQualifiedName: "System.Runtime.InteropServices.COMException,
mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
Attributes: 1056769
BaseType: {System.RuntimeType}
DeclaringType: Nothing
DefaultBinder: {System.DefaultBinder}
Delimiter: "."c
EmptyTypes: {Length=0}
FilterAttribute: {System.Reflection.MemberFilter}
FilterName: {System.Reflection.MemberFilter}
FilterNameIgnoreCase: {System.Reflection.MemberFilter}
FullName: "System.Runtime.InteropServices.COMException"
GUID: {System.Guid}
HasElementType: False
IsAbstract: False
IsAnsiClass: True
IsArray: False
IsAutoClass: False
IsAutoLayout: True
IsByRef: False
IsClass: True
IsCOMObject: False
IsContextful: False
IsEnum: False
IsExplicitLayout: False
IsImport: False
IsInterface: False
IsLayoutSequential: False
IsMarshalByRef: False
IsNestedAssembly: False
IsNestedFamANDAssem: False
IsNestedFamily: False
IsNestedFamORAssem: False
IsNestedPrivate: False
IsNestedPublic: False
IsNotPublic: False
IsPointer: False
IsPrimitive: False
IsPublic: True
IsSealed: False
IsSerializable: True
IsSpecialName: False
IsUnicodeClass: False
IsValueType: False
MemberType: TypeInfo
Missing: {System.Reflection.Missing}
Module: {System.Reflection.Module}
Name: "COMException"
Namespace: "System.Runtime.InteropServices"
ReflectedType: Nothing
TypeHandle: {System.RuntimeTypeHandle}
TypeInitializer: Nothing
UnderlyingSystemType: {System.RuntimeType}
?ex.hresult
-2147417851
Anybody had any idea how to solve this error or where to look? It's really
important! And the problem is that I need to use ADOX because of the Tables
and Procedures methods in it :-(
Thanks a lot in advance!
Pieter Coucke
I have to do some actions with the tables and query's of some
Access-Databases. The following code works for most of the Access-Databases,
but unfortunately not for all!
In some case it gives me an error, and it's always with the same
Access-database I got eveytime that error: With these Access-database it
'thinks' there aren't any Tables or Procedures in it (but there are a lot of
them in the Database)
When I looked more closely to it it gace me an exception:
"System.Runtime.InteropServices.COMException (0x80010105): The server threw
an exception."
I runned the folowwing code:
Dim ADOConnection As New ADODB.Connection
Dim cat As New ADOX.Catalog
SyncLock (GetType(clsDB))
Try
ADOConnection.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & strDirFile)
cat.ActiveConnection = ADOConnection
Try
MessageBox.Show(cat.Tables.Count)
-> On the cat.Tables.Count I got the error.
?cat.Tables.Count
<error: an exception of type: {System.Runtime.InteropServices.COMException}
occurred>
More info about the error:
?ex.tostring
"System.Runtime.InteropServices.COMException (0x80010105): The server threw
an exception.
at ADOX.Tables.get_Count()
at RefreshODBC.clsDB.subRefresh() in C:\VB NET\RefreshODBC\clsDB.vb:line
29"
?ex.gettype
{System.RuntimeType}
[System.RuntimeType]: {System.RuntimeType}
Assembly: {System.Reflection.Assembly}
AssemblyQualifiedName: "System.Runtime.InteropServices.COMException,
mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
Attributes: 1056769
BaseType: {System.RuntimeType}
DeclaringType: Nothing
DefaultBinder: {System.DefaultBinder}
Delimiter: "."c
EmptyTypes: {Length=0}
FilterAttribute: {System.Reflection.MemberFilter}
FilterName: {System.Reflection.MemberFilter}
FilterNameIgnoreCase: {System.Reflection.MemberFilter}
FullName: "System.Runtime.InteropServices.COMException"
GUID: {System.Guid}
HasElementType: False
IsAbstract: False
IsAnsiClass: True
IsArray: False
IsAutoClass: False
IsAutoLayout: True
IsByRef: False
IsClass: True
IsCOMObject: False
IsContextful: False
IsEnum: False
IsExplicitLayout: False
IsImport: False
IsInterface: False
IsLayoutSequential: False
IsMarshalByRef: False
IsNestedAssembly: False
IsNestedFamANDAssem: False
IsNestedFamily: False
IsNestedFamORAssem: False
IsNestedPrivate: False
IsNestedPublic: False
IsNotPublic: False
IsPointer: False
IsPrimitive: False
IsPublic: True
IsSealed: False
IsSerializable: True
IsSpecialName: False
IsUnicodeClass: False
IsValueType: False
MemberType: TypeInfo
Missing: {System.Reflection.Missing}
Module: {System.Reflection.Module}
Name: "COMException"
Namespace: "System.Runtime.InteropServices"
ReflectedType: Nothing
TypeHandle: {System.RuntimeTypeHandle}
TypeInitializer: Nothing
UnderlyingSystemType: {System.RuntimeType}
?ex.hresult
-2147417851
Anybody had any idea how to solve this error or where to look? It's really
important! And the problem is that I need to use ADOX because of the Tables
and Procedures methods in it :-(
Thanks a lot in advance!
Pieter Coucke