I use vb 2005 to develope a system and i also use access 2007 as my database.
The problem is i'm a no0b about this programming thing. :|
I have a form that contains textbox, radiobutton and a SEND button.
I don't know the codes for SEND button to save the data in my database.
Could somenone help me to solve this problem?
plzZZ~
Umer HayyatPosted Feb 14, 2011, 2:47 PM
this may help you little,i have used ms access 2003 using DAO in visual basic 6,
ingeneral declaration
dim db As database
dim rs As recordset
option explicit
in form load place this
set db = DBEngine.Workspaces(0).OpenDatabase(app.path &"\dbName.mdb")
set rs = db.OpenRecordset("TableNameHere", dbOpenTable)
in button place this code
rs!field = text1.text
rs.Update
this is all........
if u could not understand this, tell me, i will provide you an example for this.
Hirendra SisodiyaPosted Jan 31, 2011, 2:24 AM
if you want to save data of textbox and radiobutton in access database than you can use this code:
Dim oConn As OleDbConnection
oConn = New OleDb.OleDbConnection
oConn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "database1.accdb";Persist Security Info=False;"
oConn.Open()
Dim str As String = "Write here insert query"
Dim oCommand As New OleDbCommand(STR, oConn)
oCommand.ExecuteNonQuery()
thanks
please mark as answer if it helps