Connecting to an oracle 9.2 Database with Visual Studio 2003

G

Guest

Hi,

I have an Oracle database with about 30 tables all relations in order, data
is present in tables that require them.

I'm writing a windows service using vb .NET that polls a set of directories
for new input files (which are flat files in txt). So far so good. The data
contained in those files get parsed into an import entity that can be of the
type 'sample' or 'standard'. Yesterday i noticed that my design was done
rather poorly and decided to form a Business layer and a DAL layer. I created
my business objects (still not all business is already in it).

And now I'm trying to access my databank. I tried accessing it using OLE DB
for Oracle as well as the Oracle connection;

The problem atm is the following. When dragging either OLE DB Connection or
OracleConnection to my DAL component. When I try to create a DataAdapter I
get an errormessage displaying ORA-00162. I haven't got a clue where this
error is comming from.

Yesterday I was trying to connect to OLE DB and then an exception was thrown
(which I read on this forums had something to do with permissions and
read&execute rights on my ORA_HOME directory)

Many thanks in advance
 
G

Guest

I just Undid my code changes and retried and i'm getting the
ex.message "Oracle error occurred, but error message could not be retrieved
from Oracle." String

again.

I'll post the code that goes with it as well:

Private WithEvents selectCommand As System.Data.OleDb.OleDbCommand
Private WithEvents insertCommand As System.Data.OleDb.OleDbCommand
Friend WithEvents updateCommand As System.Data.OleDb.OleDbCommand
Friend WithEvents daStandardMeasurement As
System.Data.OleDb.OleDbDataAdapter
Friend WithEvents SaT04_DataSet1 As ARCDAL.SAT04_DataSet
Private WithEvents connStandardMeasurement As
System.Data.OleDb.OleDbConnection

.....
(within initialise component)
Me.odbcStandardMeasurement.ConnectionString = "Provider=MSDAORA;User
ID=****;Data Source=""TNSNAME.WORLD"";Password=****"
Public Function CreateStandardMeasurement(ByRef stdm As
ARCBLL.StandardMeasurement) As Long
....
Me.odbcStandardMeasurement = New System.Data.OleDb.OleDbConnection
(end initialise component)

Public Function CreateStandardMeasurement(ByRef stdm As
ARCBLL.StandardMeasurement) As Long

daStandardMeasurement.InsertCommand.Parameters.Item(0).Value = stdm.Id
daStandardMeasurement.InsertCommand.Parameters.Item(1).Value =
stdm.StandardId
daStandardMeasurement.InsertCommand.Parameters.Item(2).Value =
stdm.InstrumentId
daStandardMeasurement.InsertCommand.Parameters.Item(3).Value = 0
daStandardMeasurement.InsertCommand.Parameters.Item(4).Value =
stdm.DateMeasured

Try
connStandardMeasurement.Open()
daStandardMeasurement.InsertCommand.ExecuteNonQuery()
stdm.Id = idparam.Value
connStandardMeasurement.Close()
Catch ex As Exception
Debug.WriteLine(ex.Message.ToString())
End Try


End Function

the exception is thrown at connStandardMeasurement.Open()
 
G

Guest

About the ORA-00162 Error:

Quoted from an external site:
Mark,

OracleClient testing confirmed it to be a problem in
System.Data.OracleClient.dll
version 1.0.5000.0. We are working on a fix. In the meantime you can work
around
it by aliasing the server name in tnsnames.ora and choosing an alias that is
16 or less bytes long.

Once again, sorry about this problem

Karol Zadora, VB Team
This posting is provided "AS IS" with no warranties, and confers no rights.

So my TNS Name has to be shorter then 16 chars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top