Results 1 to 3 of 3

Thread: [RESOLVED] insert values in oracle DB

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2013
    Posts
    6

    Resolved [RESOLVED] insert values in oracle DB

    I am new to VB, i am trying to add values/details into oracle DB but i am facing some problem here. I want to store the information from the textbox that i already created the make connection to oracle DB and store them. I hope someone will guide me. Thanks.

    Code:
    Private Sub Command1_Click()
        Dim oconn As ADODB.Connection
        Dim rs As ADODB.Recordset
        Dim strSQL As String
    
        Set oconn = New ADODB.Connection
        Set rs = New ADODB.Recordset
    
        oconn.Open "DRIVER = ODBC;DSN=sss;UID=sss;PWD=sss;DATABASE=sss"
    
        strSQL = "INSERT INTO ZZZJUNKPERSON ( ID_NO, NAME, GENDER, ADDRESS, PHONE_NO ) " _
        & "VALUES ( '" & Form2.Text1.Text & "', " _
        & "' " & Form2.Text2.Text & "', " _
        & "' " & Form2.Text3.Text & "', " _
        & "' " & Form2.Text4.Text & "', " _
        & "' " & Form2.Text5.Text & "')"
    
    
    End Sub

  2. #2
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: insert values in oracle DB

    You need to execute the sql instruction, something like :
    Code:
     ocnnn.Execute strSQL
    JG


    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2013
    Posts
    6

    Re: insert values in oracle DB

    Quote Originally Posted by jggtz View Post
    You need to execute the sql instruction, something like :
    Code:
     ocnnn.Execute strSQL
    thanks man

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width