Click here to Skip to main content
15,900,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
Imports System.Data
Imports System.Data.Odbc
Partial Class _STUDENTTABLE
    Inherits System.Web.UI.Page
    Dim CON As OdbcConnection
    Dim comm As OdbcCommand
    Dim instance As OdbcDataAdapter
    Dim a As Integer
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub BTNINSERT_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BTNINSERT.Click
        CON = New OdbcConnection("DSN=DBLOG;Driver=(Oracle in XE);UID=system;PWD=SYS;SERVER=localhost;")
        CON.Open()
        MsgBox("successfully opened")
        comm = New OdbcCommand("INSERTSTUDENT", CON)
        comm.CommandType = CommandType.StoredProcedure
        comm.Parameters.AddWithValue("ID_", TXTID.Text)
        comm.Parameters.AddWithValue("STUDENTNAME_", TXTNAME.Text)
        comm.Parameters.AddWithValue("DEPARTMENT_", TXTDEPART.Text)
        comm.Parameters.AddWithValue("YEAR_", TXTYEAR.Text)
        comm = New OdbcCommand("{call INSERTSTUDENT(_,_,_,_}", CON)
        a = comm.ExecuteNonQuery()
        If a > 0 Then
            MsgBox("success")
        Else
            MsgBox("fail")
        End If
        CON.Close()
        MsgBox("successfully closed")
    End Sub
Posted
Updated 26-Jun-13 21:26pm
v2

1 solution

This should help you find the cause and probably a solution - Google search - ERROR [42000] [Oracle][ODBC]Syntax error or access violation[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900