Does DA check for the MDAC version at all?


(Alan Olson) #42

turns out there was a database server issue I wasn’t aware of. give me a few minutes and i’ll run a valid test this morning…


(Alan Olson) #43

OK, disregard my comments from earlier about SM not working. this was due to some issues and updates going on with the db server that I was using and I wasn’t made aware of.

Changing the connection string as you initially suggested now works and I see all the tables. I will move forward and see if I can generate a full schema.

Thanks, and apologies for the false information earlier.

alan


(antonk) #44

Glad that this has been sorted out.

I’ll log an issue to add the Pervasive connection profile into the main .daConfig file.


(RemObjects) #45

Thanks, logged as bugs://81044


(Alan Olson) #46

Ok, an update. I’m getting all the table names now but no field level data for building a scheme. Any ideas why?


(antonk) #47

Good question. Let’s find this out.

So when you drag a table name into the Tables list - a Schema table w/o fields is created, am I right?

In the connection tester comment all code between connection.Open() and connection.Close() and add there this code:

				var tables = connection.GetTableNames();
				var tableName = tables[0];
				var fields = connection.GetTableFields(tableName, true, null);

				Console.WriteLine("Fields loaded: " + fields.Count);

This code mimics the one used to retrieve fields list

Also add this as the first line of the Main method:

		AppDomain.CurrentDomain.FirstChanceException += CurrentDomain_FirstChanceException;

and add this method to the Program class:

	private static void CurrentDomain_FirstChanceException(object sender, System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs e)
	{
		Console.WriteLine("************************************************");
		Console.WriteLine("FirstChanceException:");
		Console.WriteLine(e.Exception.ToString());
		Console.WriteLine("------------------------------------------------");
	}

This code will reveal all exceptions (even if they are suppressed)


(Alan Olson) #48

does this make any sense?

C:\alan>connectiontester
************************************************
FirstChanceException:
System.InvalidCastException: Object cannot be cast from DBNull to other types.
   at System.DBNull.System.IConvertible.ToBoolean(IFormatProvider provider)
------------------------------------------------
System.InvalidCastException: Object cannot be cast from DBNull to other types.
   at System.DBNull.System.IConvertible.ToBoolean(IFormatProvider provider)
   at System.Convert.ToBoolean(Object value)
   at RemObjects.DataAbstract.Server.BaseConnection.GetTableFields(String tableText, Boolean isTableNameProvided, SchemaParameterCollection parameters) in c:\CI\b\rofx\917\Data Abstract for .NET\Source\RemObjects.DataAbstract.Server\ConnectionManager\BaseConnection.pas:line 740
   at ConnectionTester.Program.Main(String[] args) in D:\dev\ROTest\ConnectionTester\Program.cs:line 67

which is this line in my code

var fields = connection.GetTableFields(tableName, true, null);


(antonk) #49

Yes, it does. For some reason ADO.NET driver reports a NULL value in a column expected to have only true or false values. This causes a crash in the method so the field info is not retrieved. I’ll add checks for all fields that are used to retrieve schema to better adapt for such cases.


(RemObjects) #50

Thanks, logged as bugs://81053


(Alan Olson) #51

how involved is this? Any chance I could get a new version yet today to test further?


(RemObjects) #52

bugs://81053 got closed with status fixed.


(antonk) #53

Not sure. The full build process takes some (rather long) time.


(Alan Olson) #54

Is there a new build ready for me to test out???


(antonk) #55

It just finished. It should be available on https://www.remobjects.com/portal/downloads/personal.aspx in a few.

Please do not forget to backup the DataAbstract.daConfig your file - I haven’t merged Pervasive driver definition yet (that will be done once everything is working).


(Alan Olson) #56

Thanks Anton -

this works much better. Field definitions are now being retrieved properly, but there is one more issue. I have a lot of tables in my database, some are new, some are old, and there are a couple where the actual physical file for the table is missing. This could be for several reasons - i’m using a test server now, and not all files were copied since some are no longer used, etc. in the new Schema wizard, i’m getting the following exception:

Could this situation be addressed also? Still finish creating schema even if db table file is not found?


(RemObjects) #57

Thanks, logged as bugs://81068


(antonk) #58

I’ve logged this to add skipping tables to the Schema Modeler.
For now I’ll create a simple command-line utility for you that will import tables into a Schema. ETA for this is around 1 hour.


(antonk) #59

Here is the project: SchemaLoader.zip (4.7 KB)

You’ll need to add your modified .daConfig file as a resource and to change the connection line and destination file name.


(Alan Olson) #60

Thanks Anton -

I gave it a try but one older bug seems to have reappeared. Take a look at this screenshot:


(antonk) #61

Hmm. Odd. Does the Schema Modeler fail with the same error?

If not then please double-check that this little app does reference proper assemblies (ie the latest ones, with version # ending with .1384) and that these assemblies are deployed together with the app if you are running it on a different host.