hello,
What are the steps that i should perform or what is the piece of code that i should use to connect an access database to a VB 6.0 Form? What is the piece of code for inserting , deleting viewing, editing data in the database? Where should i put the code?
Thanks
u got 2 option
1. using ado data control
2. using coding
using adodc
1. add a adodc
2. in the properties change
connect = Access
databasename = 'find the access file'
recordsource = 'the name of the table that want to link'
3. if want to link with the text box, in the change the properties
datasourse = 'the name of the adodc'
datafield = ' the field in the table that want to link'
4. coding of adding new records
5. coding of delete
6. coding of edit
7. coding of update
8. coding of cancel update
- data1.recordset.cancelupdate
9. move data or record
- data1.recordset.movenext
-
data1.recordset.movefirst
using coding
try use this coding the different of other action is in SQL only
- Dim con As New ADODB.Connection
-
Dim con_string As String
-
Dim sql As String
-
Dim rs As New ADODB.Recordset
-
con_string = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = " & App.Path & "\" & "abc.mdb;"
-
con.Open con_string
-
-
sql = "select * from test where matrik = 123"
-
Set rs = con.Execute(sql)
hope it help
-Sky86