2 Replies - 17319 Views - Last Post: 11 March 2012 - 07:34 PM Rate Topic: -----

#1 pravvi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 02-March 12

How to use insert into sql table statement in vb6

Posted 02 March 2012 - 12:19 PM

Hi can anyone tell me how exactly do i insert values into my backend(sql-oracle 10g) using my front end? (vb6)
mine is a simple code:
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset

Private Sub Combo1_Change()
Combo1.AddItem "Web Content Development", 0
Combo1.AddItem "Client and Server Side Scripting", 1
Combo1.AddItem "Network Security Configuration", 2
Combo1.AddItem "Web Server, E-Commerce Development", 3
End Sub

Private Sub Command1_Click()

End Sub

Private Sub Form_Load()
con.Open "employees", "username", "password"
rs.Execute "insert into projects(prjcode,prjname,teamsize)values(" & Val(Text1.Text) & "," & Val(Text2.Text) & "," & Val(Text3.Text) & ") ", con, adOpenDynamic, adLockBatchOptimistic 


i have left command1 blank because i don't know what to write there...i want my program such that, during runtime i insert values in textbox and when i click the command button, a new column is added into the table projects

Is This A Good Question/Topic? 0
  • +

Replies To: How to use insert into sql table statement in vb6

#2 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 300
  • View blog
  • Posts: 1,773
  • Joined: 26-March 09

Re: How to use insert into sql table statement in vb6

Posted 04 March 2012 - 02:43 AM

Your starting point is opening the database, so have a look at this link for connection string to Oracle.

Have a look at this link for using vb6 to access oracle.

The tutorial was found at the top of the google search for "VB6 and Oracle".
Was This Post Helpful? 0
  • +
  • -

#3 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: How to use insert into sql table statement in vb6

Posted 11 March 2012 - 07:34 PM

Personally, I would use the command object for this. Recordsets are meant for select queries.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1