[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Peter Czurak

8/27/2002 12:23:00 AM

6 Answers

(Steven Bras [MS])

8/28/2002 10:04:00 PM

0

I've tested this same code on our Informix server and get no error. The
only way I could throw an error is by qualifying the table name with a
non-existent qualifier like "informix"; if I used our "pss" qualifier it
worked as expected.

Generally, these data access exceptions can be clarified if you use a
try/catch block and expose the message of the exception; this is not shown
if you do not use error handling. To do so, handle errors as follows:

Dim oCn As New OdbcConnection("dsn=informix;user
id=myid;password=mypass;")
Dim oCmd As New OdbcCommand("SELECT Count(*) From pss.customer",
oCn)
Dim oRdr As OdbcDataReader

Try
oCn.Open()
oRdr = oCmd.ExecuteReader(CommandBehavior.CloseConnection)

Catch ex As Exception
MessageBox.Show(ex.Message)

Finally
oRdr.Close()
oCn.Close()
oCn.Dispose()
End Try

You will most likely get a more descriptive error message that should help
you solve the problem.

Steven Bras, MCSD
Microsoft Developer Support/Visual Basic WebData

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.co....

Peter Czurak

8/29/2002 3:41:00 PM

0

I have tried this again and it works now, but your suggestion about
try/catch realy helps - instead of getting system errors now I get
discriptive error message with the error number. I wish i had try/catch
when I was getting the error.

Thank you


"Steven Bras [MS]" <stevenbr@online.microsoft.com> wrote in message
news:Yor5v3sTCHA.2188@cpmsftngxa10...
> I've tested this same code on our Informix server and get no error. The
> only way I could throw an error is by qualifying the table name with a
> non-existent qualifier like "informix"; if I used our "pss" qualifier it
> worked as expected.
>
> Generally, these data access exceptions can be clarified if you use a
> try/catch block and expose the message of the exception; this is not shown
> if you do not use error handling. To do so, handle errors as follows:
>
> Dim oCn As New OdbcConnection("dsn=informix;user
> id=myid;password=mypass;")
> Dim oCmd As New OdbcCommand("SELECT Count(*) From pss.customer",
> oCn)
> Dim oRdr As OdbcDataReader
>
> Try
> oCn.Open()
> oRdr = oCmd.ExecuteReader(CommandBehavior.CloseConnection)
>
> Catch ex As Exception
> MessageBox.Show(ex.Message)
>
> Finally
> oRdr.Close()
> oCn.Close()
> oCn.Dispose()
> End Try
>
> You will most likely get a more descriptive error message that should help
> you solve the problem.
>
> Steven Bras, MCSD
> Microsoft Developer Support/Visual Basic WebData
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> Are you secure? For information about the Microsoft Strategic Technology
> Protection Program and to order your FREE Security Tool Kit, please visit
> http://www.microsoft.co....
>


Richard Hill

8/29/2002 8:15:00 PM

0

I'm using the native oledb provider from the Informix
Client SDK 2.7. This way, I don't have to use odbc.net and
can use the oledb.net provider instead. It requires some
minor setup on the db as well as in SetNet32, but makes
for a better performing connection. Hope this helps.

Regards,
Richard


>-----Original Message-----
>Has anyone had success retreiving data from Informix
database?
>Here is a sample code I am using and I get the following
error message when I executer this code
>"myReader = myCommand.ExecuteReader();"
>
>An unhandled exception of
type 'Microsoft.Data.Odbc.OdbcException' occurred in
microsoft.data.odbc.dll
>Additional information: System error.
>
>What am I doing wrong?
>
>Here is the code I am using:
>
>
> string myConnString = "DSN=InforixDatabase";
> string mySelectQuery = "SELECT Count(*) from
Informix.mytable";
> OdbcConnection myConnection = new OdbcConnection
(myConnString);
> OdbcCommand myCommand = new OdbcCommand
(mySelectQuery,myConnection);
> myConnection.Open();
> OdbcDataReader myReader;
> myReader = myCommand.ExecuteReader(); // <-- this is
where the error occurs
>
>
>Thanks
>
>
>--
>Peter
>pczurak@bigfoot.com
>
>

(Steven Bras [MS])

9/3/2002 5:21:00 PM

0

My pleasure; I'm glad I was able to be of assistance. Good luck with your
project!

Steven Bras, MCSD
Microsoft Developer Support/Visual Basic WebData

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.co....

Carsten Störkel

9/27/2002 2:44:00 PM

0

Hi Richard,

can you give some hint how to configure the OLE DB Provider for Informix ?
The Sql-script coledb.sql is applied to the sysmaster database but i still
get some error when i try to open the connection.

Thx
Carsten

carsten.stoerkel@ixtra.com

"Richard" <richard.hill@sonoco.com> schrieb im Newsbeitrag
news:1005301c24f88$14ca1610$39ef2ecf@TKMSFTNGXA08...
> I'm using the native oledb provider from the Informix
> Client SDK 2.7. This way, I don't have to use odbc.net and
> can use the oledb.net provider instead. It requires some
> minor setup on the db as well as in SetNet32, but makes
> for a better performing connection. Hope this helps.
>
> Regards,
> Richard
>
>
> >-----Original Message-----
> >Has anyone had success retreiving data from Informix
> database?
> >Here is a sample code I am using and I get the following
> error message when I executer this code
> >"myReader = myCommand.ExecuteReader();"
> >
> >An unhandled exception of
> type 'Microsoft.Data.Odbc.OdbcException' occurred in
> microsoft.data.odbc.dll
> >Additional information: System error.
> >
> >What am I doing wrong?
> >
> >Here is the code I am using:
> >
> >
> > string myConnString = "DSN=InforixDatabase";
> > string mySelectQuery = "SELECT Count(*) from
> Informix.mytable";
> > OdbcConnection myConnection = new OdbcConnection
> (myConnString);
> > OdbcCommand myCommand = new OdbcCommand
> (mySelectQuery,myConnection);
> > myConnection.Open();
> > OdbcDataReader myReader;
> > myReader = myCommand.ExecuteReader(); // <-- this is
> where the error occurs
> >
> >
> >Thanks
> >
> >
> >--
> >Peter
> >pczurak@bigfoot.com
> >
> >


Samuel

10/23/2002 4:03:00 PM

0

Richard,

I was using OLEDB.NET to access an Informix database. The
OLEDB driver was the one from Client SDK 2.7, then I
migrated the driver to Client SDK 2.8.
In both cases I can do everything with OLEDB (select,
insert, update, delete & transaction), the only problem I
had was when using the system in production environment -
as the IIS server loses the connection to INFORMIX and
the only way to fix this is to reset ISS.

Recently I migrated the whole code to use ODBC.NET and
the IIS server hasn't crashed (yet), but the problem I'm
facing now is to process TRANSACTIONS - as the
application hangs when the code issue the 1st execute
call.

Do you have any experience with ODBC.NET using
TRANSACTIONS? or, Did you experience any kind of IIS
crashing on heavy usage?

Thansk in advance,

Samuel


>-----Original Message-----
>I'm using the native oledb provider from the Informix
>Client SDK 2.7. This way, I don't have to use odbc.net
and
>can use the oledb.net provider instead. It requires some
>minor setup on the db as well as in SetNet32, but makes
>for a better performing connection. Hope this helps.
>
>Regards,
>Richard
>
>
>>-----Original Message-----
>>Has anyone had success retreiving data from Informix
>database?
>>Here is a sample code I am using and I get the
following
>error message when I executer this code
>>"myReader = myCommand.ExecuteReader();"
>>
>>An unhandled exception of
>type 'Microsoft.Data.Odbc.OdbcException' occurred in
>microsoft.data.odbc.dll
>>Additional information: System error.
>>
>>What am I doing wrong?
>>
>>Here is the code I am using:
>>
>>
>> string myConnString = "DSN=InforixDatabase";
>> string mySelectQuery = "SELECT Count(*) from
>Informix.mytable";
>> OdbcConnection myConnection = new OdbcConnection
>(myConnString);
>> OdbcCommand myCommand = new OdbcCommand
>(mySelectQuery,myConnection);
>> myConnection.Open();
>> OdbcDataReader myReader;
>> myReader = myCommand.ExecuteReader(); // <-- this is
>where the error occurs
>>
>>
>>Thanks
>>
>>
>>--
>>Peter
>>pczurak@bigfoot.com
>>
>>
>.
>