Hello Folks ,,
i'v a simple question,, how can I add a row to an Access database in run time ,,
I mean what is the code for creating a new record..
thanx in advance
..:: Creating new row ::..
Started by bahrain, Jan 23 2009 07:16 AM
5 replies to this topic
#1
Posted 23 January 2009 - 07:16 AM
|
|
|
#2
Guest_Jordan_*
Posted 23 January 2009 - 08:55 AM
Guest_Jordan_*
The SQL is
INSERT INTO <table> (<colname>,<colname>,<colname>, etc) VALUES('value1','value2','value3','etc);
#3
Posted 23 January 2009 - 09:56 AM
thanx man ,
but I'm using Access
but I'm using Access
#4
Guest_Jordan_*
Posted 23 January 2009 - 10:03 AM
Guest_Jordan_*
Can you not do SQL with Access?
#6
Posted 23 January 2009 - 02:19 PM
Option Strict Off
Option Explicit On
Public Class Form1
dim a, b, c as string
Dim DataBase As dao.Database
Dim Table As dao.Recordset
Dim OpenDataBasee As New dao.DBEngine
a = textbox1.text
b = textbox2.text
c= textbox 3.text
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
DataBase = OpenDataBasee.OpenDatabase("Your's Database Path")
Table = DataBase.OpenRecordset("Your Table Name")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Table.addNew()
Table.Fields("How ever you called the firs column").Value = a
Table.Fields("How ever you called the second column").Value = b
Table.Fields("How ever you called the third column").Value = c
End Sub
End Class
Edited by Jordan, 23 January 2009 - 03:16 PM.


Sign In
Create Account


Back to top









