List:MySQL ODBC« Previous MessageNext Message »
From:Ed Kraft Date:June 18 2003 8:55pm
Subject:126 error code?
View as plain text  
Hey All,

Does anyone know what this means exactly?  :

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
Specified driver could not be loaded due to system error 126 (MySQL ODBC
3.51 Driver).

I got this error when I tried installing myODBC on our Windows server.
I receive this error in the ASP page I have, and also when I try and
setup a DSN in IIS.  The only thing I could find out about this error
code is that is has something to do with an invalid file format.  Is
there a different driver I need for a server?

Any help would be much appreciated.

Thanks,

Ed


-----Original Message-----
From: Raj Muchhala [mailto:Raj.Muchhala@stripped] 
Sent: Wednesday, June 18, 2003 10:10 AM
To: 'myodbc@stripped'
Subject: .Net, myodbc, & last_insert_id()


The "last_insert_id()" command does not appear to be working.  If I run
an insert through MyODBC and immediately follow it with a "SELECT
last_insert_id()" nothing is returned.  Even more interestingly, if I
run the insert through MyODBC and do the last_insert_id via a MySql
console nothing is returned.  But, if I do both via a MySql console, it
works fine AND repeated calls to last_insert_id on the console will ONLY
return values from inserts done via the console.  This tells me that the
MyODBC driver is not "registering", somehow, an insert command...
hopefully the above was not too confusing.  Here are some specifics:
 
Using DBToolsManager as a GUI console to MySQL.
 
Using .Net platform, C# and MyODBC 3.51 to connect to MySQL.  Using
ODBCDataAdapter to automagically manage the Insert and am capturing the
RowUpdated Event (raised by the Adapter) so I can do the
"Last_insert_id()" command.
 
C# code as follows:
 
public void UpdateRow(){
    System.Data.Odbc.OdbcDataAdapter ladp;
    System.Data.Odbc.OdbcConnection lcn;
  
    lcn = this.GetConnection();
    ladp = new System.Data.Odbc.OdbcDataAdapter();
    //Wire the event listed below
    ladp.RowUpdated +=new OdbcRowUpdatedEventHandler(ladp_RowUpdated);
    ladp.InsertCommand = new System.Data.Odbc.OdbcCommand();
    ladp.InsertCommand.CommandText = @"INSERT INTO tbl_individuals
(vc_first_name, vc_last_name, id_user, id_created, id_updated,
id_active) VALUES (? , ? , 1, now(), now(), -1)";
     ladp.InsertCommand.Parameters.Add("@vc_first_name",
OdbcType.VarChar, 50, "vc_first_name");
    ladp.InsertCommand.Parameters.Add("@vc_last_name", OdbcType.VarChar,
50, "vc_last_name");
    ladp.InsertCommand.Connection = lcn;
    ladp.Update(ldts.Members);
    lcn.Close();
    ladp.Dispose();
    ladp = null;
}
 
private void ladp_RowUpdated(object sender, OdbcRowUpdatedEventArgs e) {

 System.Data.Odbc.OdbcConnection lcn;
 int lintID = 0;
 if (e.StatementType==StatementType.Insert)
  {
  lcn = this.GetConnection();
  System.Data.Odbc.OdbcCommand lcmd = new OdbcCommand();
  try
  {
  lcmd.Connection = lcn;
  lcmd.CommandText = "SELECT LAST_INSERT_ID()";
  lintID = (string)lcmd.ExecuteScalar();
  }
  catch (System.Exception ex)
  {
  System.Diagnostics.Debug.WriteLine(ex.StackTrace);
  }
  e.Row["id"] = lintID;
}
 
 
Note:  as I write this, it occurs to me that maybe the issue is with the
ODBCDataAdapter object.  I will test and see if it works using a
"standalone" ODBCCommand Object...
 
Thanks in advance for any help,
 
Raj 

Thread
.Net, myodbc, & last_insert_id()Raj Muchhala18 Jun
  • 126 error code?Ed Kraft18 Jun
RE: .Net, myodbc, & last_insert_id()Mike Hillyer18 Jun
  • RE: .Net, myodbc, & last_insert_id()Scott Nichols18 Jun
RE: 126 error code?Mike Hillyer18 Jun
  • Re: 126 error code?Venu18 Jun
    • RE: 126 error code?Ed Kraft18 Jun
    • Re: 126 error code?Nils Valentin21 Jun
  • RE: 126 error code?Ed Kraft18 Jun
RE: .Net, myodbc, & last_insert_id()Mike Hillyer18 Jun
RE: 126 error code?Ed Kraft19 Jun
  • Re: 126 error code?Danny Haworth19 Jun
  • ADO generating 800a01fb Errors with MyODBC (ASP)Chris Gamache19 Jun
  • Re: 126 error code?Nils Valentin21 Jun
RE: .Net, myodbc, & last_insert_id()Raj Muchhala19 Jun