Search found 18 matches

by davidkennedy
Tue 26 Sep 2006 04:09
Forum: SQL Server Data Access Components
Topic: Trapping MS SQL DB_E_INTEGRITYVIOLATION
Replies: 2
Views: 3846

Trapping MS SQL DB_E_INTEGRITYVIOLATION

I am tasked with converting many Delphi tables to MS SQL. Whenever I find an DB_E_INTEGRITYVIOLATION violation of trying to write an orphan record into the MS SQL database, it blows up with an error message and halts operation (in the IDE and running as an .exe). I posted a message last week that you were kind enough to describe the error checking code, but the problem is that when the execution blows in the TRY section attempting a RECORD.POST it never gets to the EXCEPT statement to 'gently' execute the error resolution routine. Here is the example,
var - add these;
E, i : integer;

The nerveracking part of trying to catch the MSSQL exception is that it doesn't ever move into the exception (EXCEPT) area. When I trace this through the code, the RECORD.POST throws the MSSQL exception in the TRY part, and doesn't drop out to the EXCEPT loop. The 'catch 22' part of all this is that I can't then put the exception code in the TRY part because the error exception objects only have scope in the EXCEPT area. Here's the code showing this phenomina;
try
OutTable.Post;
except
on E: EOLEDBError do
begin
for i := 0 to EOLEDBError(E).ErrorCount - 1 do
if EOLEDBError(E).Errors.ErrorCode = DB_E_INTEGRITYVIOLATION then
begin
ErrTable.insert;
ErrTable.FieldByName('IntKey1').Value := KeyInt;
ErrTable.FieldByName('DateKey').Value := KeyDate;
ErrTable.FieldByName('RecDesc').Value := 'Tx Convert';
ErrTable.FieldByName('StrKey2').Value := 'orphan';
ErrTable.post;
end;
break;
end;
I need to find a way to A: write the record, B: write the error record and C: move on to the next input record. Thank you.
by davidkennedy
Fri 22 Sep 2006 17:40
Forum: SQL Server Data Access Components
Topic: MS SQL is 'bullying' my Delphi routine?
Replies: 4
Views: 3217

MS SQL exceptions don't seem to 'throw exceptions' the right way?

For those following this thread I enclose answers to my last two questions;
uses - add these
OLEDB, OLEDBAccess

var - add these;
E, i : integer;

The nerveracking part of trying to catch the MSSQL exception is that it doesn't ever move into the exception (EXCEPT) area. When I trace this through the code, the RECORD.POST throws the MSSQL exception in the TRY part, and doesn't drop out to the EXCEPT loop. The 'catch 22' part of all this is that I can't then put the exception code in the TRY part because the error exception objects only have scope in the EXCEPT area. Here's the code showing this phenomina;
try
OutTable.Post;
except
on E: EOLEDBError do
begin
for i := 0 to EOLEDBError(E).ErrorCount - 1 do
if EOLEDBError(E).Errors.ErrorCode = DB_E_INTEGRITYVIOLATION then
begin
ErrTable.insert;
ErrTable.FieldByName('IntKey1').Value := KeyInt;
ErrTable.FieldByName('DateKey').Value := KeyDate;
ErrTable.FieldByName('RecDesc').Value := 'Tx Convert';
ErrTable.FieldByName('StrKey2').Value := 'orphan';
ErrTable.post;
end;
break;
end;
I need to find a way to A: write the record, B: write the error record and C: move on to the next input record. I've tried this in the IDE and as an .exe and it behaves the same.
Thank you.
by davidkennedy
Fri 22 Sep 2006 16:34
Forum: SQL Server Data Access Components
Topic: MS SQL is 'bullying' my Delphi routine?
Replies: 4
Views: 3217

Thank you Evgeniv,
Do I use "OLEDB" in the uses clause of my Delphi unit?
What type of variable to I create to catch this "E" instance of on E: (EOLEDBError)?
I tried creating a
var
E : EOLEDBError;
and it wouldn't compile
Are there any other common errors in a data conversion that I should code for besides "DB_E_INTEGRITYVIOLATION" ?
Thank you.
by davidkennedy
Thu 21 Sep 2006 12:13
Forum: SQL Server Data Access Components
Topic: MS SQL is 'bullying' my Delphi routine?
Replies: 4
Views: 3217

MS SQL is 'bullying' my Delphi routine?

I am using a TRY, EXCEPT loop to convert my old Delphi tables and trying to capture non-conforming (orphan records) MSSQL records and place them into an error file called "ErrTable" (which is an SQL generated table). I am able to trap the error records into my ErrTable and generate my own error message to the user, BUT then the MS SQL engine throws an error message of it's own (describing this record violates the data integrity of the table(s) as the record in question has no parent record to legitimize it.) I am going to be converting thousands of records and can't stop for each error, delete the foul record, and start again.
Is there some type of command I can put in the EXCEPT section that takes the MS SQL error and posts it into the ErrTable table so the program execution can move on?
TRY
OutTable.Post;
EXCEPT
ErrTable.insert;
ErrTable.FieldByName('IntKey1').Value := KeyInt;
ErrTable.FieldByName('DateKey').Value := KeyDate;
ErrTable.FieldByName('RecDesc').Value := 'Tx Convert';
ErrTable.post;
MessageDlg('Cannot write record ' + 'InttoStr(KeyStr)', mtInformation, [mbOk], 0);
InTable.next;
END;
by davidkennedy
Tue 08 Aug 2006 19:37
Forum: dotConnect for MySQL
Topic: Anyone actually written a 'real' 3 tier appication in ASP with MySQLDirect.NET?
Replies: 3
Views: 3028

"you may simply create a dataset" = NOT!

I am never able to get the Data Wizard to produce anything. I've tried hundreds of times and now Alexey tells me I need VS.NET Professional???
by davidkennedy
Wed 02 Aug 2006 13:54
Forum: dotConnect for MySQL
Topic: Anyone actually written a 'real' 3 tier appication in ASP with MySQLDirect.NET?
Replies: 3
Views: 3028

Anyone actually written a 'real' 3 tier appication in ASP with MySQLDirect.NET?

Is there anyone out there that's actually written an ASP application using MySQLDirect.NET that uses ObjectDataSources?
I've contacted everyone in this forum who lists a website or email address. I've had 5 responses and not one of these uses this product in ASP.

Just today I contacted the woman who left her name and number in the forum entry Visual Studio .NET Data Connection. She has been programming in Java for 10 years and tried these tools and just GAVE UP!

I'm hoping that if someone out there really needs to use this capability that we could team up?

Every screen that is supposed to work in manuals and Microsoft examples, doesn't with this product. If I can get someone to steer me through this maize, I'd be happy to write up a fully functional example and record it in stereo in Windows Media Player .wmv to share with others.
Thank you,
David Kennedy
[email protected]
775-885-9125
by davidkennedy
Fri 28 Jul 2006 19:22
Forum: dotConnect for MySQL
Topic: Understanding your WEB example?
Replies: 1
Views: 1719

Understanding your WEB example?

Alexey,
I've been following through your \Samples\Web\CS. Thank you for telling me about it.
In the code below what class contains the DataBind() method. What object is being forced to databind?
protected void btExecute_Click(object sender, System.EventArgs e) {

try {
mySqlConnection.UserId = tbUser.Text;
mySqlConnection.Password = tbPassword.Text;
mySqlConnection.Host = tbHost.Text;
mySqlConnection.Database = tbDatabase.Text;
mySqlConnection.Port = Convert.ToInt32(tbPort.Text);

mySqlCommand.CommandText = tbSQL.Text;

mySqlDataAdapter.Fill(dataSet, "Table");
dataGrid.DataSource = "Table";

DataBind();
lbResult.Visible = true;
}
catch (Exception exception) {
lbError.Text = exception.Message;
}
by davidkennedy
Thu 27 Jul 2006 23:44
Forum: dotConnect for MySQL
Topic: Created database with 'Componet Designer' view but data controls can't see?
Replies: 11
Views: 3160

Created database with 'Componet Designer' view but data controls can't see?

I swear if I could find a working example of your components in a simple ASP application I'd at least have some hope of struggling through this. I found that your Dataset Wizard only creates .xsd files which I can't figure out how one could use?
Next, I am manually able to put components onto a form in Component Designer view and hook these up fine. Then I try to use a data control on the same form (in designer view) and they can never see the data source from the MySQL dbExplorer.
Does someone have a simple ASP application that might show how this is all put together?
Thank you,
David Kennedy
by davidkennedy
Thu 27 Jul 2006 15:58
Forum: dotConnect for MySQL
Topic: Understanding Dataset Wizard?
Replies: 1
Views: 1650

Understanding Dataset Wizard?

Alexey, I am trying to figure out how your product works and every time you simple tell me to read the documentation. I know you understand the documentation, because you wrote it. I on the other hand see infinite hyperlinks that take me further from seeing "the forest through the trees". I tried to find someone to pay to help me in this endeavor and I can't seem to find anyone conversant on your product. So here goes..
I created a web page with an associated .cs file. I open your Dataset Wizard and make a connection to my MySQL database. Then I selected all of my tables. Now, it comes to the "Data Source Type" what do these three mean 1.) None (Use Command Schema 2. Table Adapters 3. Data Adapters?
My intention is to describe data sources in my Web.Config so they are universal to the application.
David Kennedy
by davidkennedy
Thu 27 Jul 2006 13:24
Forum: dotConnect for MySQL
Topic: Can I hire someone or get some help in understanding how to use SQLDirect?
Replies: 6
Views: 3871

Can I hire someone or get some help in understanding how to use SQLDirect?

I'm sure this is a wonderful product and I've looked at the online help files for hours, but can't seem to see the 'forest through the trees'. In the next few years I'm going to have to create many 3 tiered ASP systems that intimately deal with MySQL databases. I'm happy to spend the money if I could find someone that could do a little 'mentoring'. I live in Texas and thought a few phone calls might get me going. I've read every ASP.NET 2.0 book I can find from Amazon.com and have followed them through page by page, so hopefully I have a good enough background that we might communicate. Thank you for your consideration.
David 775-885-9125
by davidkennedy
Sun 23 Jul 2006 16:54
Forum: dotConnect for MySQL
Topic: Asp.NET 2.0 Web Administration Tool - Need Schemas to build in MySQL?
Replies: 1
Views: 1714

Asp.NET 2.0 Web Administration Tool - Need Schemas to build in MySQL?

In studying ASP 2.0 I find that the LOGIN components expect to connect to a database in the Web.Config to store information such as username and password.
When I study examples in training books they provide a SecurityFile.mdf for machines that defaults to MS SQL.
I'm thinking that if I could find out the schemas for this and other files that VS.NET 2005 using ASP expects to have, I could create them and continue using examples in the many ASP.NET 2.0 books I am working with.
Does anyone have these schemas, or know where to find them?
I've installed the MySQL Connector Net 1.0.7 and the Web Administration Tool recognizes the MySQL tools in the Provider Configuration tabsheet under Select a different provider for each feature (advanced) so I've made it that far.
Thank you.
by davidkennedy
Thu 20 Jul 2006 18:15
Forum: dotConnect for MySQL
Topic: "Failed to Create Component" (whenever I drag any MySQL componet to form?
Replies: 2
Views: 1781

"Failed to Create Component" (whenever I drag any MySQL componet to form?

Whenever I drag any of my MySQL components from the Toolbox to the Component Designer form I blow up with a message that starts out "Failed to create componet "component name" then goes on with a bunch of error messages that start
System.Runtime.InterOPservices.COMException (blah, blah).
Any component I drag give the same message.[/img]
by davidkennedy
Thu 20 Jul 2006 17:51
Forum: dotConnect for MySQL
Topic: VWD
Replies: 12
Views: 5563

Did you guys figure out why the MySQL components are GREYED OUT?

I've read through your list of reasons why the components in the toolbox are greyed out and tried everything. Did anybody conclude how to make these tools available?
Thanks
by davidkennedy
Thu 20 Jul 2006 17:43
Forum: dotConnect for MySQL
Topic: MySQL components are GREYED OUT in the Toolbox for ASP project?
Replies: 1
Views: 1496

MySQL components are GREYED OUT in the Toolbox for ASP project?

MySQL components show in the Toolbox but are GREYED OUT and unavailable. I followed the instructions in the manual to create a tab and then add the MySQL items to the tab.
The regular DATA components that ship with VS.NET 2005 are available when designing an ASP 2.0 form.
Why is this?
I've tried rebuilding the Toolbox item many times and re-adding the MySQL components, but they just won't show?
Thank you
by davidkennedy
Wed 12 Jul 2006 14:21
Forum: MySQL Data Access Components
Topic: Delphi Table Currency value to MySQL table $78.98 turns into $79.00?
Replies: 2
Views: 2835

Newbee didn't decimal (7,2) set decimal places in the SQL schema

I am guilty of not places the decimal places in the SQL schema. I have finished quite a substantial conversion process between Delphi tables and MySQL tables if anyone would like the code.
Thanks,
David