954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

oracle connection from VB.NET 2003

Hi All

I am trying to connect to my database from the front end in VB.NET 2003, the connection strings that i have tried are not working at present. I have VB.NET 2003 program from last year but that was using access as the back end and VB.NET 2003 as the front end. This year i must use oracle as the back end and Vb.Net 2003 as the front end. The connection strings that i have tried do not seem to be correct but i will keep trying it is probably something simple. Yes the database does connect through odbc and the tns file is correct

kenneth17
Newbie Poster
4 posts since Oct 2007
Reputation Points: 10
Solved Threads: 0
 

this is what i use with vb and oracle 10g:

strCon = "Driver={Microsoft ODBC for Oracle}; " & _
         "CONNECTSTRING=(DESCRIPTION=" & _
         "(ADDRESS=(PROTOCOL=TCP)" & _
         "(HOST=111.222.333.18)(PORT=1521))" & _
         "(CONNECT_DATA=(SERVICE_NAME=mydata))); uid=user_id;pwd=your_psw;"

Dim oCon 
oCon.Open strCon
alidabiri
Newbie Poster
5 posts since Oct 2007
Reputation Points: 13
Solved Threads: 0
 

try to use this as connection string.

Provider=OraOLEDB.Oracle.1;Password=tiger;Persist Security Info=True;User ID=scott;Data Source=orcl


hope that solves your problem.

debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
 
try to use this as connection string. Provider=OraOLEDB.Oracle.1;Password=tiger;Persist Security Info=True;User ID=scott;Data Source=orcl hope that solves your problem.


This seems to be ok but will not return any information from oracle database, keeps falling over when i try to open a form when in run time. error is

An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll

Dim ConnectionData As String = "Provider=OraOLEDB.Oracle.1;Password=tigger;Persist Security Info=True;User ID=ken;Data Source=derby"



        Dim DA As New OleDb.OleDbDataAdapter(SQLComm, ConnectionData)
        Dim DT As New DataTable
        DA.Fill(DT)      ''''' Falls over here when i open a form at runtime:confused: 
        DA.Dispose()

        Return DT
    End Function
kenneth17
Newbie Poster
4 posts since Oct 2007
Reputation Points: 10
Solved Threads: 0
 

That might be because of the driver is not installed properly.

try to use the following

Provider=MSDAORA.1;Password=tiger;User ID=scott;Data Source=orcl;Persist Security Info=True

debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You