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

Recommended Answers

All 4 Replies

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

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.

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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.