S
smitty_one_each
A couple questions on ADO.Net.
a) Is the functionality of the ADOX.Catalog.Create() method available
in System.Data.OldDB anywhere?
b) When creating a database using DDL against Jet 4.0, I encounter a
problem adding Procedures to the .mdb file, after successfully creating
a bunch of tables via the Command.Execute() method.
For valid command and catalog objects, the C# code will error after
on the second Append() call, irrespective of which order I place these
(i.e., the SQL itself is valid):
cmd.CommandText = "PARAMETERS doc_name TEXT(255); "
+ "INSERT INTO tbl_doc (doc_name) "
+ "VALUES ([doc_name]); ";
cat.Procedures.Append( "qapp_doc", cmd );
cmd.CommandText = "PARAMETERS word_text TEXT(255); "
+ "INSERT INTO tbl_word (word_text) "
+ "VALUES ([word_text]); ";
cat.Procedures.Append( "qapp_word", cmd );
The error is a System.Runtime.InteropServices.COMException , "DBID is
invalid".
I am using Microsoft Visual C# .NET 69586-335-0000007-18478, against
a Jet4.0 (ADO 2.8) installation.
I also tried variations such as s/VALUES ([doc_name])/SELECT doc_name
AS Expr1/ which the Query design grid of MS Access would generate, with
a depressing lack of affection from the system.
I also have *not* tried explicitely Appending the Parameter objects to
my cmd variable prior to Append()ing to the Procedures collection. As
I'm only stashing the procedure objects at the moment, not actually
executing them, this seemed unnecessary effort. Post-mortem inspection
of the .mdb (via MS Access) indicates that the first procedure is, in
fact, properly created.
Possibly I may need to punt on the ADODB, and instead re-connect with
OleDB to support building this file.
Any insight deeply appreciated.
Thanks,
Chris
a) Is the functionality of the ADOX.Catalog.Create() method available
in System.Data.OldDB anywhere?
b) When creating a database using DDL against Jet 4.0, I encounter a
problem adding Procedures to the .mdb file, after successfully creating
a bunch of tables via the Command.Execute() method.
For valid command and catalog objects, the C# code will error after
on the second Append() call, irrespective of which order I place these
(i.e., the SQL itself is valid):
cmd.CommandText = "PARAMETERS doc_name TEXT(255); "
+ "INSERT INTO tbl_doc (doc_name) "
+ "VALUES ([doc_name]); ";
cat.Procedures.Append( "qapp_doc", cmd );
cmd.CommandText = "PARAMETERS word_text TEXT(255); "
+ "INSERT INTO tbl_word (word_text) "
+ "VALUES ([word_text]); ";
cat.Procedures.Append( "qapp_word", cmd );
The error is a System.Runtime.InteropServices.COMException , "DBID is
invalid".
I am using Microsoft Visual C# .NET 69586-335-0000007-18478, against
a Jet4.0 (ADO 2.8) installation.
I also tried variations such as s/VALUES ([doc_name])/SELECT doc_name
AS Expr1/ which the Query design grid of MS Access would generate, with
a depressing lack of affection from the system.
I also have *not* tried explicitely Appending the Parameter objects to
my cmd variable prior to Append()ing to the Procedures collection. As
I'm only stashing the procedure objects at the moment, not actually
executing them, this seemed unnecessary effort. Post-mortem inspection
of the .mdb (via MS Access) indicates that the first procedure is, in
fact, properly created.
Possibly I may need to punt on the ADODB, and instead re-connect with
OleDB to support building this file.
Any insight deeply appreciated.
Thanks,
Chris