My project is Housing reservation system for University

I design the interfaces by VB and connect to my oracle data base account

Oracle 11g, VB express edition are used

The proble is with the login form

when I debug and enter the ID & password for User :

according to my code :

Imports Oracle.DataAccess.Client
Imports Oracle.DataAccess.Types

Public Class Login_Page
    Dim cn As OracleConnection
    Dim cmd As OracleCommand
    Private Sub Login_Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


    End Sub

    Private Sub NameLabel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim cn As New OracleConnection
        Dim connString As String = "User Id=08120168;Password=8080;Data Source=dell"
        cn = New OracleConnection(connString)
        Dim ser = CInt(NameTextBox.Text)
        Dim pw = PasswordTextBox.Text
        cn.Open()
        

        cmd = New OracleCommand("SELECT * FROM LOGIN_STUDENT WHERE USER_ID like '%" & ser & "' AND PASSWORD like '%" & pw & "'", cn)

        Dim myreader As OracleDataReader = cmd.ExecuteReader()

        If (myreader.Read() = True) Then

            MessageBox.Show("The user is valid!")
            
            studentpage.Show()        

        Else

            MessageBox.Show("Invalid username or password!")

        End If

    End Sub

it suppose to connect and show the messege:The user is valid

but it does not and a 'FileNotFoundException was unhandled'window appears and running stop and hang

** The same code had been tried in another computers which are 32 bit and work successfuly but in my computer(64 bit) not work.

** Is 32 bit or 64 bit affect ?
** What can i do to solve this problem?
** could any one help

Dani AI

Generated

— the runtime FileNotFoundException on a 64‑bit PC while the same project runs on 32‑bit machines is almost always a deployment/bitness problem with Oracle's provider (or a missing native library), not a VB logic bug. 's suggestion to verify the Oracle client tools (sqlplus/tnsping) on that machine is a good first step — if the client tools fail, the problem is client/TNS/installation.

Quick troubleshooting checklist (in order):

  • Inspect the exception details / InnerException to see the exact filename that can't be found. That tells you whether the missing item is the managed assembly (Oracle.DataAccess.dll) or a native DLL like oci.dll.
  • Verify Oracle client utilities can connect from the PC (sqlplus or tnsping). If they fail, reinstall or reconfigure the client/TNS.
  • Confirm bitness: a process compiled as AnyCPU will run 64‑bit on 64‑bit Windows. If only a 32‑bit Oracle client/ODP.NET is installed, a 64‑bit process cannot load the native OCI library. In VB Express set Project → Properties → Compile → Advanced Compile Options → Target CPU = x86, rebuild and retest. If that fixes it, you have a bitness mismatch.
  • Make sure the Oracle home/bin folder is on the machine PATH so OCI.dll can be found, or install the matching ODP.NET for your target bitness.

Options to fix:

  • Install the 64‑bit Oracle client and ODP.NET to match a 64‑bit process.
  • Force the app to run 32‑bit (x86) so it uses an existing 32‑bit client.
  • Or avoid native-dependency problems entirely by using Oracle’s managed provider (Oracle.ManagedDataAccess) which is pure .NET.

Example (managed provider + parameters; also prevents SQL injection and avoids using LIKE for numeric IDs):

Imports Oracle.ManagedDataAccess.Client

Dim cs As String = "User Id=08120168;Password=8080;Data Source=dell"
Using conn As New OracleConnection(cs)
    conn.Open()
    Dim sql As String = "SELECT COUNT(*) FROM LOGIN_STUDENT WHERE USER_ID = :id AND PASSWORD = :pw"
    Using cmd As New OracleCommand(sql, conn)
        cmd.Parameters.Add("id", OracleDbType.Int32).Value = Integer.Parse(NameTextBox.Text)
        cmd.Parameters.Add("pw", OracleDbType.Varchar2).Value = PasswordTextBox.Text
        Dim cnt As Integer = Convert.ToInt32(cmd.ExecuteScalar())
        If cnt > 0 Then MessageBox.Show("The user is valid!") Else MessageBox.Show("Invalid username or password!")
    End Using
End Using

A final note: 's ODBC/OLE DB suggestion is a valid fallback, but remember Windows 64‑bit has separate 32‑bit and 64‑bit ODBC administrators (use the 32‑bit odbcad32.exe for 32‑bit drivers). If the error persists, the exact exception message (including InnerException) and the process bitness will pinpoint which library is missing.

Recommended Answers

All 4 Replies

Can you access the database server from the 64-bit machine using sqlplus? If not, perhaps you have not properly installed the Oracle client tools/code on the 64-bit machine?

I'm proberly installed the oracle code even the teacher make sure about it but still the problem in the path

pleaze any one can help
what to do

It may be a Unicode issue in that what you think you are asking for, and what is really on the system are different - single-byte name vs. multi-byte Unicode name. Other than this possibility, I'm out of ideas... :-(

see this link
http://www.daniweb.com/software-development/vbnet/threads/26939


further more try and use ODBC to connect with database. eg

Oracle ODBC Connection String
Driver={Microsoft ODBC for Oracle};Server=myservername;Uid=myusername;Pwd=mypassword;

Oracle OLEDB Connection String
Provider=msdaora;Data Source=mydemodb;User Id=myusername;Password=mypasswd;

Oracle .Net Connection String
Data Source=mydemodb;User Id=myusername;Password=mypasswd;Integrated Security=no;

hope this helps.

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.