Hello...
i'm very beginner in vb2008. i need to connect two forms with ms access. first form is connect with second using(form2.show). my need is when i execute the coding. i got a error on first form " An error occurred creating the form. See Exception.InnerException for details. The error is: Operation is not allowed when the object is closed. "
How can i solve the issue..
and also add,update, delete from database..
This is my codes:
this is first form:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Dim form As Form3
Form3.Show()
this is my second form:
Dim conn As New ADODB.Connection
Dim connectionString
Dim DB As DataSet
Dim instace As MissingSchemaAction
Dim rs As New ADODB.Recordset
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles can.Click
Me.Close()
Form2.Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'On Error Resume Next
connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:\db1.mdb;Persist Security Info=False"
conn.Open(connectionString)
rs.Open("insert into table1(Name,Address,Contact_Number,vat) values ('" & snm.Text & "','" & sadd.Text & "'," & Val(scno.Text) & " , " & Val(svat.Text) & ")", conn)
'rs.Open("insert into table1(Id,Name,Address,Contact_Number,vat) values ('2','sam','abc street','22','12')", conn)
rs = Nothing
MsgBox("account saved")
End Sub
help me plz.. urgent
Plz help me..
thank you
Tags: Visual Basic (Visual Basic 8 (2005)), Microsoft, Microsoft Access